map-projections

Aligning topojson file with preset projection with points with point locations loaded via an api

三世轮回 提交于 2019-12-24 10:36:52
问题 Thanks to a previous answer I was able to use geoproject to set the projection of my geojson to BC Albers. geoproject 'd3.geoAlbers().parallels([50, 58.5]).rotate([126, 0]).center([0,50.5]).fitSize([960, 600], d)' < "$<" > "$@" I'm then loading the topojson into d3 with a null projection var path = d3.geoPath() .projection(null); Everything looks fine when loaded, however when I then load point locations through an api and set the projection to match the topojson file var projection = d3

Setting a custom projection using d3-geo-projection command line tool

微笑、不失礼 提交于 2019-12-24 09:33:21
问题 I'm trying to use geoproject to set the projection on a geojson file. Specifically I'm trying to set the projection to BCalbers (http://spatialreference.org/ref/epsg/3005/) I see geoproject has a number of projections options i.e. geoproject 'd3.geoAlbersUsa()' us.json \ > us-albers.json but it is possible to set a custom projection using the command line tool? I was hoping something like this would be possible: geoproject '+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y

Multiple maps with d3.js: change values of scale and center

一曲冷凌霜 提交于 2019-12-24 07:45:28
问题 I’m building a (d3 v4) cartographic visualization which allows the user to switch between many datasets (json files) and two different regions (administrative units of a country and smaller administrative units into its capital city). Actually the switch from one to another dataset on the initial country level works well, through buttons and jquery. Problem: it’s a bit less convincing when switching to a map/dataset about the capital city, as the projection is initially set for the whole

how to snip or crop or white-fill a rectangle tightly surrounding the outside of a polygon with ggplot2

为君一笑 提交于 2019-12-23 20:19:12
问题 I'm just trying to white-fill the area outside of a simple polygon. For some reason, it's screwing up by drawing a weird stake through the center like it thinks its a vampire slayer or something. I tried following this post but something's gone bananas. I would've thought this would be easier, but it's proving to be quite an irascible little demon. How do I white-fill the area outside a projection-friendly polygon without screwing up the area inside the polygon? thanx # reproducible example

How does the function “extract” deal with different projections?

偶尔善良 提交于 2019-12-23 02:30:16
问题 I need to use the function extract() to do a weighted average extraction from a raster using a grid cell of equal sized squares. My polygon grid is in UTM21n and the raster is in GCS WGS84 datum D. Do I have to reproject the raster before using it into extract()? Or will the function handle it properly? 回答1: You can find the source code of function extract for SpatialPolygons here. The code starts with the following snippet: setMethod('extract', signature(x='Raster', y='SpatialPolygons'),

d3.js mercator projection to NYC map

一笑奈何 提交于 2019-12-22 20:48:19
问题 I am making a map of the boroughs in NYC and I can't seem to get the projection right: the only thing I get is a tiny map. I tried recreating this example, which only made the console go crazy with errors, I suspect because there was something off about the equation. When I was trying to get albers to work, I tried out the answer to this question, and still I could not get the map to work. With 960/500 height and width, I used: var projection = d3.geo.albers().center([40.71, 73.98]).parallels

How to tell KmlLayer about custom map projection?

↘锁芯ラ 提交于 2019-12-22 08:04:06
问题 I have a map with a custom projection (for maps.yandex.ru tiles) and default projection (Google and OSM tiles). When I add KmlLayer to map in the default projection it seems ok: But switching map to maps.yandex layer (in custom projection)... and kml-objects are misplaced. How do I tell KmlLayer about custom projection? 回答1: The way I understand it, any given object that has lat/lon (a,b) under a Mercator projection will have a different value than (a,b) under a custom projection. For example

Compute Shader write to texture

只谈情不闲聊 提交于 2019-12-22 05:32:12
问题 I have implemented CPU code that copies a projected texture to a larger texture on a 3d object, 'decal baking' if you will, but now I need to implement it on the GPU. To do this I hope to use compute shader as its quite difficult to add an FBO in my current setup. Example image from my current implementation This question is more about how to use Compute shaders but for anyone interested, the idea is based on an answer I got from user jozxyqk, seen here: https://stackoverflow.com/a/27124029

How can you crop raster layers in R in a batch and change projection

拥有回忆 提交于 2019-12-21 21:27:07
问题 I was working with spatial data to get ready for analyses - I have a DEM at the desired extent of my study area, though I have ~39 other layers at the national scale (US). Is there a way to crop all of these 39 layers to the same extent as the DEM at once? Also, I will be overlaying the output with other layers in a different projection. Is it possible to adjust the projection and pixel size of the output layers? I am trying to use freeware as much as possible for my data manipulation... 回答1:

how to snip or crop or white-fill a large. expanded (by 10%) rectangle outside of a polygon with ggplot2

[亡魂溺海] 提交于 2019-12-20 10:40:07
问题 this question is a follow-up of my prior SO question and is related to this question. i'm just trying to white-fill an area 10% bigger than a simple polygon with ggplot2. maybe i'm grouping things wrong? here's a photo of the spike with reproducible code below # reproducible example library(rgeos) library(maptools) library(raster) shpct.tf <- tempfile() ; td <- tempdir() download.file( "ftp://ftp2.census.gov/geo/pvs/tiger2010st/09_Connecticut/09/tl_2010_09_state10.zip" , shpct.tf , mode = 'wb