shapefile

Android lib to read or parse shapefile

試著忘記壹切 提交于 2019-11-27 15:16:41
问题 is there any library that is able to read parse a .shp file, preferably on where I don't need to use NDK. I was trying to use GeoTools but i can't seam to get it to work on Android. 回答1: I've been using two lightweight shapefile parsers with good results in Android: diewald_shapeFileReader and Java ESRI Shape File Reader. Geotools relies heavily on AWT and Java Service Provider Interface (SPI) both not supported by Android. So it´s not a viable option. 来源: https://stackoverflow.com/questions

Clipping raster using shapefile in R, but keeping the geometry of the shapefile

[亡魂溺海] 提交于 2019-11-27 11:42:16
问题 I am using {raster} to clip (or crop) a raster based on an irregular shapefile (the Amazon biome) but the output always has a rectangular extent. However, I need the output in the exact same geometry of the shapefile. Any tips? Cheers. library(raster) library(rgdal) myshp <- readOGR("Amazon.shp", layer="Amazon") e <- extent(myshp) myraster <- raster("Temperature.tif") myraster.crop <- crop(myraster, e, snap="out", filename="myoutput.tif") 回答1: One option is to use raster::mask() library

Check if a geopoint with latitude and longitude is within a shapefile

时光怂恿深爱的人放手 提交于 2019-11-27 10:30:30
How can I check if a geopoint is within the area of a given shapefile? I managed to load a shapefile in python, but can't get any further. Richard This is an adaptation of yosukesabai's answer. I wanted to ensure that the point I was searching for was in the same projection system as the shapefile, so I've added code for that. I couldn't understand why he was doing a contains test on ply = feat_in.GetGeometryRef() (in my testing things seemed to work just as well without it), so I removed that. I've also improved the commenting to better explain what's going on (as I understand it). #!/usr/bin

Does anyone know of a library in Java that can parse ESRI Shapefiles?

二次信任 提交于 2019-11-27 06:11:25
I'm interested in writing a visualization program for the road data in the 2009 Tiger/Line Shapefiles . I'd like to draw the line data to display all the roads for my county. The ESRI Shapefile or simply a shapefile is a popular geospatial vector data format for geographic information systems software. It is developed and regulated by ESRI as a (mostly) open specification for data interoperability among ESRI and other software products. 1 A "shapefile" commonly refers to a collection of files with ".shp", ".shx", ".dbf", and other extensions on a common prefix name (e.g., "lakes.*"). The

Intersecting Points and Polygons in R

旧时模样 提交于 2019-11-27 06:02:50
问题 I am working with shapefiles in R , one is point.shp the other is a polygon.shp. Now, I would like to intersect the points with the polygon, meaning that all the values from the polygon should be attached to the table of the point.shp. I tried overlay() and spRbind in package sp, but nothing did what I expected them to do. Could anyone give me a hint? 回答1: If you do overlay(pts, polys) where pts is a SpatialPointsDataFrame object and polys is a SpatialPolygonsDataFrame object then you get

sp::over() for point in polygon analysis

有些话、适合烂在心里 提交于 2019-11-27 00:54:34
问题 I have a shapefile named "ind_adm" and a SpatialPointsDataFrame called "pnts". The "pnts" contains points generated at random, and some of the points overlap with the polygon. See picture below. Now, I want do do a point in polygon analysis, i.e. I want to find out which points lie inside the gray polygon representing the boundary of India. For this I am using the over() function in the sp library. pt.in.poly <- sp::over(ind_adm, pnts, fn = mean) #do the join However, the output I am getting

Create convex hull polygon from points and save as shapefile

喜你入骨 提交于 2019-11-26 19:54:27
问题 Needing some help re a conversion problem in R. I've got calculated the convex hull of a cloud of points. I'd like, from the points forming the convex hull, to build a polygon object and save that as a shapefile that can be read by a GIS software (ArcMap or the like). My code looks like this: gps <- read.csv(f) ##reads the lat-long coordinates file x <- gps$LONGITUDE ##tells R which columns is which y <- gps$LATITUDE z<-chull(x,y) ##calculates the convex hull --this is just a list of x-y

Check if a geopoint with latitude and longitude is within a shapefile

天涯浪子 提交于 2019-11-26 15:09:49
问题 How can I check if a geopoint is within the area of a given shapefile? I managed to load a shapefile in python, but can't get any further. 回答1: This is an adaptation of yosukesabai's answer. I wanted to ensure that the point I was searching for was in the same projection system as the shapefile, so I've added code for that. I couldn't understand why he was doing a contains test on ply = feat_in.GetGeometryRef() (in my testing things seemed to work just as well without it), so I removed that.

Different legends and fill colours for facetted ggplot?

一世执手 提交于 2019-11-26 11:23:17
问题 Sorry for not included any example data for my problem. I couldn’t find a way to easily produce an example shape file. Hopefully, experienced users of ggplot can see what I’d like to do from the description below. I’ve got: A data.frame X with information about sample plots ( plotid , var1 , var2 , var3 , var4 , …) A polygon shapefile Y with spatial information for the sample plots Importation of the shapefile Y (with maptools ) and fortify ing as data.frame Z ( ggplot2 ) works fine. melt ing