map-projections

D3 V4 Properly placing a bubble in the US Map

给你一囗甜甜゛ 提交于 2019-12-20 05:25:37
问题 I am creating a US Map and I have a series of ACTUAL coordinates of some places in US. I would like to put a point or bubble on the right spot in the map. How do I scale/translate these? This is what I get: With what I have tried: function USAPlot(divid, data) { var margin = { top: 20, right: 20, bottom: 30, left: 50 }, width = 1040 - margin.left - margin.right, height = 700 - margin.top - margin.bottom; // formatting the data data.forEach(function (d) { d.loc = d.location; d.count = d.count;

How to change a Lambert Conic Conformal raster projection to latlon degree R

白昼怎懂夜的黑 提交于 2019-12-20 02:38:38
问题 I have a raster, obtained from a netcdf which is in (Lambert Conic Conformal projection): library(meteoForecast) wrf_temporary <- getRaster("temp", day = Sys.Date(), frames = 'complete', resolution = 36, service = "meteogalicia") wrf_temporary extent : -18, 4230, -18, 3726 (xmin, xmax, ymin, ymax) coord. ref. : +proj=lcc +lat_1=43 +lat_2=43 +lat_0=34.82300186157227 +lon_0=-14.10000038146973 +x_0=536402.34 +y_0=-18558.61 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=km +no_defs Now I want to

d3 world map with country click and zoom almost working not quite

 ̄綄美尐妖づ 提交于 2019-12-19 09:25:12
问题 I am working on a world map that features a click to zoom feature. When clicking a country the map zooms in but the country is not always centered -- the same happens when you click out and repeat, it never seems to deliver the same result. Note: If you disable the transition function, the zoom and centering does work, only when rotation is added it displays incorrectly. What is wrong with my code? I created a plunker for convenience http://plnkr.co/edit/tgIHG76bM3cbBLktjTX0?p=preview <

D3.js Map with Albers Projection: How to rotate it?

雨燕双飞 提交于 2019-12-17 05:14:39
问题 I'm building a map of the Philippines with d3.js and for a strange reason the map looks like rotated on the left, so that the country doesn't look how it really is. I've tried to modify the projection.rotate field but doesn't seems like is the correction line. var width = 1060, height = 860; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .style("overflow", "auto"); d3.json("ph.json", function(error, ph) { if (error) return console.error(error); var

Tile Projection Google Maps: Convert Distance to Screen Dimensions

谁说胖子不能爱 提交于 2019-12-12 05:49:40
问题 I am using the CanvasTileProvider in Google Maps Android v2. I can convert lat long points to screen pixels. However I would like to create a method to convert a distance to screen pixels. This will allow me to draw a circle of x radius. Can anyone help with this? The code below I have butchered and modified from somewhere else so credit to the original author. /** * Converts between LatLng coordinates and the pixels inside a tile. */ public class TileProjection { public int x; public int y;

D3js circles on a map : Projection Issue?

纵饮孤独 提交于 2019-12-12 02:15:42
问题 Once again i'm searching for some help. I manage to draw my map but when i attempt to add circles (stores locations from csv), my points appears in the left corner and i'm getting the following errors > Error: <circle> attribute cx: Expected length, "NaN". Error: <circle> > attribute cy: Expected length, "NaN". Error: <circle> attribute r: > Expected length, "NaN". I read many posts here in stack and i read the basic tutorial from Mike Bostock but can't manage to have my points at the right

Creating world file for maptiler

跟風遠走 提交于 2019-12-11 07:44:51
问题 I have an image which 21810x14872 that project a box of an area with coordinate: top, left corner latitude longitude : 23.635069763547662 , 58.09107365049769 bottom, right corner latitude longitude : 23.598520470202025 , 58.14957297881731 OR using WGS84 northing, easting: top, left corner easting, northing : 617289.588, 2610249.342 bottom, right corner easting, northing : 611289.588, 2614249.428 My image use projection of WGS84. How do I create world file for maptiler using above description.

Calculate selected area from stacked raster object

徘徊边缘 提交于 2019-12-11 06:48:16
问题 As I have only recently started using R for spatial analysis, and I am not a geographer or spatial data specialist by any means, I have a -what I presume to be- relatively simple question. I am trying to calculate the area of part of a stacked raster object that meets certain conditions. More specifically, from a dataset from the deep sea in the south Atlantic, I have stacked two raster objects (depth and slope) that are further identical in coordinate system (WGS84) and x-y (Lat-Long)

Calculating Mercator d3 scaling to match Leaflet zoom level

三世轮回 提交于 2019-12-11 05:28:00
问题 Given a Leaflet zoom level (0..22), how would I calculate D3 scaling value for geoMercator projection? At zoom=0, the whole world fits within a single tile (256x256). In tiles, the world size is 2^zoom x 2^zoom tiles. 回答1: For comparison with d3 scales for Mercator maps: A mercator map uses this formula: var point = [x, Math.log(Math.tan(Math.PI / 4 + y / 2))]; The scale factor in a d3 map essentially applies the following transform: point[0] = point[0] * k; point[1] = -point[1] * k; The

rDGAL, Tiff Files, and WorldFile

元气小坏坏 提交于 2019-12-11 04:45:16
问题 I have a set of tiff files that display convective weather across the continental US (NAD83 projection) in pixel locations from Iowa State University. My goal is the transformation of the pixel locations to lat/lon data. I read in the tiff file data as a SpatialGridDataFrame with... imageData = readGDAL( fileNameDir, silent = TRUE ) I read somewhere that readGDAL will seek a World File if no projection data exist in the tiff file, so I created such a file (nad83WorldFile.wld) with the