map-projections

Raster image seems to be shifted using leaflet for R

夙愿已清 提交于 2019-12-05 21:03:15
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, each = n), nrow = n) Y = matrix(rep(y, m), nrow = n) # collector dataframe points = data.frame(value =

How to tell KmlLayer about custom map projection?

血红的双手。 提交于 2019-12-05 16:18:16
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? 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, if your custom projection was polar, the object would have distance from a fixed point and an angle from a

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

放肆的年华 提交于 2019-12-05 12:23:30
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: [[42.353770, -71.103606], [42.355447, -71.104475], [42.362681, -71.089830], [42.361829, -71.079230]]

Compute Shader write to texture

断了今生、忘了曾经 提交于 2019-12-05 06:11:18
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/2579996 The texture that is written-to is in my code called _texture , whilst the one projected is

How to transform coordinate from WGS84 to a coordinate in a projection with PROJ.4?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 18:54:23
问题 I have a GPS-coordinate in WGS84 that I would like to transform to a map-projection coordinate in SWEREF99 TM using PROJ.4 in Java or Proj4js in JavaScript. Its hard to find documentation for PROJ.4 and how to use it. If you have a good link, please post it as a comment. The PROJ.4 parameters for SWEREF99 TM is +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs I have tried to use a PROJ.4 Java library for transforming Lat: 55° 00’ N, Long: 12° 45’ E and tried with this

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

时间秒杀一切 提交于 2019-12-04 18:05:53
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... I had the problem above, but have written a function in R to do all of this in a batch - see below. I had

Efficient way to plot data on an irregular grid

巧了我就是萌 提交于 2019-12-04 11:11:33
问题 I work with satellite data organized on an irregular two-dimensional grid whose dimensions are scanline (along track dimension) and ground pixel (across track dimension). Latitude and longitude information for each centre pixel are stored in auxiliary coordinate variables, as well as the four corners coordinate pairs (latitude and longitude coordinates are given on the WGS84 reference ellipsoid). The data is stored in netCDF4 files. What I am trying to do is efficiently plotting these files

How to transform a distance from degrees to metres?

瘦欲@ 提交于 2019-12-03 09:03:11
问题 I'm using OpenLayers with an ordinary mercator map and I'm trying to sample a bounding box by finding a grid of points in latlong. The bbox is expressed in latlon, e.g. 48.1388,-15.3616,55.2057,-3.9359 I can define a distance in degrees (e.g. x: 2.5, y: 2.4) and work out the points from there. But I'd like to express this distance in metres (e.g. 50000) in order to relate it to the user mindset (people understand metres, not degrees). How can I convert this distance? I know how to reproject a

Efficient way to plot data on an irregular grid

风格不统一 提交于 2019-12-03 06:14:43
I work with satellite data organized on an irregular two-dimensional grid whose dimensions are scanline (along track dimension) and ground pixel (across track dimension). Latitude and longitude information for each centre pixel are stored in auxiliary coordinate variables, as well as the four corners coordinate pairs (latitude and longitude coordinates are given on the WGS84 reference ellipsoid). The data is stored in netCDF4 files. What I am trying to do is efficiently plotting these files (and possibly a combination of files—next step!) on a projected map. My approach so far, inspired by

Plotting custom json maps with D3.js

人走茶凉 提交于 2019-12-02 08:12:27
问题 I am creating a map with D3.js. I began by downloading the country (Canada) shapefile here: https://www.arcgis.com/home/item.html?id=dcbcdf86939548af81efbd2d732336db ..and converted it into a geojson here (link to file below): http://mapshaper.org/ So far all I see is a coloured block, without any errors on the console. My question is, how can I tell if my json file or my code is incorrect? Here is my code and on bottom is a link to json file. <!DOCTYPE html> <html> <head> <meta charset="utf