map-projections

how to project a flat image to spherical mercator EPGS:900013 to use in a Image Layer in openlayers

依然范特西╮ 提交于 2019-12-11 02:26:35
问题 I have a flat 400x400 pixels image which represents an area of 400x400 kilometers. I need to draw this image as an overlay on my OpenLayers mapping system. I use OpenStreetMap/Google Maps as base layers. I want to draw the overlay image using an Image Layer and I want to center my overlay image at a specific lat/lon point. The projection of the base layer is EPSG:900913 which is, in fact, the projection used by OpenStreetMap and Google Maps. What I have understood (please correct me if I'm

d3 fitSize gives NaN values

☆樱花仙子☆ 提交于 2019-12-10 23:16:39
问题 I want to make my d3 map fit to a svg container created with dynamic width and height attributes. It works so far by using the following code: var height = $("#map-container").height(), width = height * 0.9; var svg = d3.select("#map-container") .append("svg") .attr("width",width) .attr("height",height); d3.queue() .defer(d3.json,"./data/simplified20.json") .await(drawMap); function drawMap(error,bw) { if (error) throw error; var features = bw.features; var projection = d3.geoMercator()

Set the right crs on sf object to plot coordinate points

最后都变了- 提交于 2019-12-10 15:10:06
问题 I'm trying to define the right CRS for my sf object. I want to plot points atop the following layer (country: the Netherlands): Simple feature collection with 380 features and 3 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: 13565.4 ymin: 306846.2 xmax: 278026.1 ymax: 619232.6 epsg (SRID): NA proj4string: +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs output: This layer has the correct projection

Change projection in MSSQL for web mapping (Leaflet,Openlayer, OpenStreetMaps, GoogleAPI, …) to WSG48 or any other format

感情迁移 提交于 2019-12-10 08:12:34
问题 I have some WKT/WKB data in the MSSQL server like this and would like to show them on the map with the help of leaflet, Openlayer, OpenStreetMaps, or GoogleAPI. My data look likes this: POLYGON ((1736946.0983 5923253.9175, 1736895.6852 5923333.9451, 1736936.0082 5923356.6991, ......)) in this format EPSG:2193 as shown below and would like to convert them to WGS48 or EPSG:4326 I am trying to add them to leaflet, and seems that I need to convert this data to an appropriate format like this: [

Pacific-centric Robinson projection with ggplot in R

跟風遠走 提交于 2019-12-08 06:07:22
问题 I'm trying to create a pacific-centric Robinson projection in R with ggplot... converting a shapefile to a Robinson CRS using spTransform and setting longitude to 150 degrees doesn't work, and fortify errors out. like this: world_robin <- spTransform(world2, CRS("+proj=robin +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")) plot(world_robin, col = "khaki", bg = "azure2") And there doesn't appear to be a way to do it later in the process when setting a projection for

Raster image seems to be shifted using leaflet for R

喜欢而已 提交于 2019-12-07 14:26:38
问题 I want to plot some spatial data using the leaflet package in R, however the generated raster image seems to be shifted compared to a reference grid. I suspect map projection issue, but I am not expert on the topic, so any help would be appreciated. Here is a minimal code to plot the map: library(leaflet) library(sp) library(raster) set.seed(111) # create dummy data -rectangular grid with random values m = 10 n = 10 x = seq(45,48,length.out = m) y = seq(15,18,length.out = n) X = matrix(rep(x,

Pacific-centric Robinson projection with ggplot in R

心不动则不痛 提交于 2019-12-06 16:04:44
I'm trying to create a pacific-centric Robinson projection in R with ggplot... converting a shapefile to a Robinson CRS using spTransform and setting longitude to 150 degrees doesn't work, and fortify errors out. like this: world_robin <- spTransform(world2, CRS("+proj=robin +lon_0=150 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")) plot(world_robin, col = "khaki", bg = "azure2") And there doesn't appear to be a way to do it later in the process when setting a projection for ggmap: ie, coord_map("mollweide", orientation=c(90, 0, 150)) this appears to be the best, but it's not

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

∥☆過路亽.° 提交于 2019-12-06 15:47:03
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? 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'), function(x, y, fun=NULL, na.rm=FALSE, weights=FALSE, cellnumbers=FALSE, small=FALSE, df=FALSE, layer, nl,

d3.js mercator projection to NYC map

我的未来我决定 提交于 2019-12-06 05:59:06
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([29.5, 45.5]).scale(10000).translate([(width) / 2, (height)/2]); Right now, I am using a transverse

Plotting topojson file with d3.js (NYC boroughs and census tracts)

僤鯓⒐⒋嵵緔 提交于 2019-12-05 22:44:31
here is the first topojson question on so. I am having problems rendering a map (NYC boroughs) and can't figure out why. The code below is just a copy of this example with a different topojson file. I have uploaded the file here . Below are also the details about how I created the file. Right now, I am just getting chaotic lines. Probably, the reason is the topojson file but I don't know what's wrong. ps: I was unable to tag this as topojson because the tag has not been used before TopoJSON file 1) Download shapefile from here (Under “Borough & Community Districts” the file “Boroughs” (left),