shapefile

Plotting shapefiles on top of Google map tiles [closed]

蓝咒 提交于 2019-12-03 10:12:35
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I have some shapefiles I want to plot over Google Maps tiles. What's the most efficient way to do this? One path might be to use the pkg RgoogleMaps, however, it is still unclear to me how to do this. I assume using PlotonStaticMap with some combination of reformatting the shapefile

How to pick up the information for the nearest associated polygon to points using R?

倖福魔咒の 提交于 2019-12-03 08:35:39
I'm figuring out how to do a Intersection (Spatial Join) between point and polygons from shapefiles. My idea is to get the closest points and those points that match completely inside the polygons. In ARGIS there's a function for match option named CLOSEST and they have defined by: "The feature in the join features that is closest to a target feature is matched. It is possible that two or more join features are the same distance away from the target feature. When this situation occurs, one of the join features is randomly selected as the matching feature." I have a function to intersect points

How to combine state-level shapefiles from the united states census bureau into a nationwide shape

╄→尐↘猪︶ㄣ 提交于 2019-12-03 07:40:53
The census bureau doesn't provide a nationwide shapefile of public use microdata areas (the smallest geography available on the American Community Survey). I tried combining them all with a few different methods, but even the one that de-dupes identifiers breaks once it hits California. Am I doing something silly or does this require a difficult workaround? Here's code to reproduce up to the point where things break. library(taRifx.geo) library(maptools) td <- tempdir() ; tf <- tempfile() setInternet2( TRUE ) download.file( "ftp://ftp2.census.gov/geo/tiger/TIGER2014/PUMA/" , tf ) al <-

Add Polygons to R shiny leaflet map

无人久伴 提交于 2019-12-03 07:22:53
问题 How do I add polygons from Global Administrative areas, so they are clickable. The simple way describe in the docs that I tried is adm <- getData('GADM', country='UKR', level=1) leaflet() %>% addTiles() %>% addPolygons(data=adm, weight = 3, fillColor = col) But imagine I want a leaflet map that will have onClick actions later. Based on SuperZip, I need to have something similar to map <- createLeafletMap(session, "map") session$onFlushed(once=TRUE, function() { map$addPolygon(...) }) However,

Projecting my shapefile data on leaflet map using R

别等时光非礼了梦想. 提交于 2019-12-02 19:49:23
I (on Win7) was trying to get my shapefile data ( Here are the data files.) to be displayed using leaflet package. But without any success. I only get the background map tile but not my data. I am able to see my data in QGIS though. I got the following code and description from here . library(rgdal) shapeData <- readOGR(".",'myGIS') ogrInfo(".",'myGIS') leaflet() %>% addTiles() %>% setView(lng = -106.363590, lat=31.968483,zoom=11) %>% addPolygons(data=shapeData,weight=5,col = 'red') %>% addMarkers(lng = -106.363590,lat=31.968483,popup="Hi there") This is what I see in my internet browser. I do

Overlay shapefile and rasterlayer in R?

流过昼夜 提交于 2019-12-02 14:54:59
问题 I have a raster layer with climate data from the north of Mexico, part of Canada and the US mainland. I am trying to restrict the climate data to only the zone of the US mainland. To do this I thought it would be easy to import a US mainland map and overlay it with my raster data (of course this is turning out to be a lot more difficult than I thought). So far, using the rgdal library, I have managed to import a shapefile including the USA mainland map with states divisions. Now I want to

How to add shapefiles to a Bing Map using Openlayers 3

戏子无情 提交于 2019-12-02 07:32:14
I am using Openlayers3 with Bing Maps to build my application. I have a point shapefile and would like to show it on the map. I could do it using Openlayers2 using the OpenLayers.Layer.GML() construct but am facing difficulty while trying to the same with Openlayers 3. I tried searching for this and the openlayer example gives me an error: 'Cannot read property 'ogc' of undefined'. My shapefile is on GeoServer in my own system. So any help regarding this matter is highly appreciated :) The example you linked is from a very old beta version of OpenLayers 3. You can find the examples from the

D3js SVG open lines display a fill artifact, how to fix it?

微笑、不失礼 提交于 2019-12-02 06:52:14
问题 I just added French rivers_lines to my D3js generated SVG. It now display a result like : I need to keep the river lines without the artifact. Data : a topojson made of arcs. CSS code: .rivers { fill: none; fill-opacity: .1; stroke-width:1px; stroke: #C6ECFF; } same result with some colors and opacity near zero: fill: #FF0000; fill-opacity: .1; D3 code: rivers = topojson.feature(fra, fra.objects.rivers), //Append rivers svg.append("path") .datum(rivers) .attr("d", path) svg.selectAll(".rivers

D3js SVG open lines display a fill artifact, how to fix it?

ぃ、小莉子 提交于 2019-12-02 02:16:22
I just added French rivers_lines to my D3js generated SVG. It now display a result like : I need to keep the river lines without the artifact. Data : a topojson made of arcs. CSS code: .rivers { fill: none; fill-opacity: .1; stroke-width:1px; stroke: #C6ECFF; } same result with some colors and opacity near zero: fill: #FF0000; fill-opacity: .1; D3 code: rivers = topojson.feature(fra, fra.objects.rivers), //Append rivers svg.append("path") .datum(rivers) .attr("d", path) svg.selectAll(".rivers") .data(topojson.feature(fra, fra.objects.rivers).features) .enter().append("path") .attr("class",

How to bypass permission denied error?

南笙酒味 提交于 2019-12-02 00:42:28
问题 The following example writes a point shapefile to disc. However, I get an error when the script tries to write a shapefile to C:/. I am able to write to a external hard drive though (G:/). The following is the error I receive in R: Error in file(out.name, "wb") : cannot open the connection In addition: Warning message: In file(out.name, "wb") : cannot open file 'c:/test.shp': Permission denied How can I bypass or resolve this error? # available from: cran.r-project.org/web/packages/shapefiles