shapefile

Add new column attribute to the shapefile and save it to database using Geotools Java

╄→гoц情女王★ 提交于 2019-12-23 01:29:09
问题 I am transforming a shapefile by adding a new column attributes. Since this task is performed using Java, the only option I know for now is using Geotools. I have 2 main concerns: 1. I am not able to figure out how do I actually add a new column variable. Is the feature.setAttribute("col","value") the answer? I see from this post just the example:https://gis.stackexchange.com/questions/215660/modifying-feature-attributes-of-a-shapefile-in-geotools but I dont get the solution. //Upload the

Intersections of 3D polygons in python

别说谁变了你拦得住时间么 提交于 2019-12-22 09:28:12
问题 Are there any open source tools or libraries (ideally in python) that are available for performing lots of intersections with 3D geometry read from an ESRI shapefile? Most of the tests will be simple line segments vs polygons. I've looked into OGR 1.7.1 / GEOS 3.2.0, and whilst it loads the data correctly, the resulting intersections aren't correct, and most of the other tools available seem to build on this work. Whilst CGAL would have been an alternative, it's license isn't suitable. The

Error when opening shapefile

会有一股神秘感。 提交于 2019-12-22 08:10:51
问题 I am trying to open a shapefile in R, but I am getting the following error message: Error in getinfo.shape(filen) : Error opening SHP file I have checked other responses and most problems seem to have been solved by ensuring that the .dbf and .shx files are in the same folder. I have them all in the same folder (along with some other extensions too) but I still get the error message. I work on a mac. This is my code: getinfo.shape("/Users/Suz/Desktop/DWH satellite maps/20100517_Composite.shp"

Python: how to create a choropleth map out of a shapefile of Canada?

女生的网名这么多〃 提交于 2019-12-22 01:50:30
问题 My goal here is to create a choropleth map of Canada in Python. Suppose I have a dictionary with values referring to each Canadian province/territory: myvalues={'Alberta': 1.0, 'British Columbia': 2.0, 'Manitoba': 3.0, 'New Brunswick': 4.0, 'Newfoundland and Labrador': 5.0, 'Northwest Territories': 6.0, 'Nova Scotia': 7.0, 'Nunavut': 8.0, 'Ontario': 9.0, 'Prince Edward Island': 10.0, 'Quebec': 11.0, 'Saskatchewan': 12.0, 'Yukon': 13.0} Now I want to color each province based on the

Create a grid inside a shapefile

早过忘川 提交于 2019-12-21 23:20:04
问题 I am trying to crate a grid inside a shapefile, something like this. However, I am unable to generate such grid. I was wondering if anyone has an idea on how to accomplish this. Here is my code - WWWL.Shape<- readOGR("E:/Juan Arango", "WWL_Commerce_OK") WWWL.Shape plot(WWWL.Shape) proj4string(WWWL.Shape) bb <- bbox(WWWL.Shape) cs <- c(3.28084, 3.28084)*6000 # cell size cc <- bb[, 1] + (cs/2) # cell offset cd <- ceiling(diff(t(bb))/cs) # number of cells per direction grd <- GridTopology

How to convert csv to shp in R

六眼飞鱼酱① 提交于 2019-12-21 23:05:29
问题 I have been trying for the past couple of days to convert a csv to shapefile. I know I can easily do in QGIS or Arc but would like to add this process into my existing R code. So i can read in the csv with no issues MyData <- read.csv(file="c:/TheDataIWantToReadIn.csv", header=TRUE, sep=",") I found the code below from the Packages Shapefile help guide. However I can't seem to find a way for it to work on my code. My rows are each a point, therefore my shapefile I am trying to create will be

Global Raster of geographic distances

情到浓时终转凉″ 提交于 2019-12-21 21:46:31
问题 Im wondering if someone has built a raster of the continents of the world where each cell equals the distance of that cell cell to the nearest shore. This map would highlight the land areas that are most isolated inland. I would imagine this would simply rasterize a shapefile of the global boundaries and then calculate the distances. 回答1: You can do this with raster::distance , which calculates the distance from each NA cell to the closest non- NA cell. You just need to create a raster that

making a choropleth in R: merging zip code shapefiles from multiple states

十年热恋 提交于 2019-12-21 04:59:13
问题 Motivated by the post here, Developing Geographic Thematic Maps with R, I was thinking about constructing a choropleth map based on zip codes. I've downloaded the shape files for New Hampshire and Maine from http://www.census.gov/geo/www/cob/z52000.html, but I'm interested in combining or merging the .shp files from these two states. Is there a mechanism in the maptools package for doing this kind of merge or concatenation of two .shp files after you read them in using readShapeSpatial() ?

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

牧云@^-^@ 提交于 2019-12-21 01:06:32
问题 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()

Creating Shapefiles in R

一世执手 提交于 2019-12-20 12:37:49
问题 I'm trying to create a shapefile in R that I will later import to either Fusion Table or some other GIS application. To start,I imported a blank shapefile containing all the census tracts in Canada. I have attached other data (in tabular format) to the shapefile based on the unique ID of the CTs, and I have mapped my results. At the moment, I only need the ones in Vancouver and I would like to export a shapefile that contains only the Vancouver CTs as well as my newly attached attribute data.