Tag Info

New answers tagged

1

I think you should have a look at cshapes it... "provides historical maps of state boundaries and capitals in the post-World War II period". You can download a shapefile and query the data using the fields containing the year to evaluate how country shapes have changed over time. I found this website by first looking on the PennLibraries website.


2

1) The easiest solution is to use the processing module in the QGIS Python console: import processing processing.runalg("qgis:joinattributesbylocation","BKMapPLUTO.shp","DCP_nyc_freshzoning.shp","['intersects']",0,"sum,mean,min,max,median",0,'result.shp') 2) Without a GIS, you can use Fiona (read and write shapefiles as Python dictionaries) and Shapely ...


1

Apparently the ESRI Shape format doesn't support SmallInt and Integer. Shape does not support small integer (16bit) or integer (32bit) data types. Instead, it supports a number(x,y) data type. The equivalent data types are: smallint (16bit): number(6,0) integer (32bit): number(11,0) FME Shape Reader/Writer documentation So the answer ...


1

This sort of problem is what the topology tool was made for: Create a topology for this layer using the "No Gaps" rule Validate the topology Add it the TOC Use the fix topology tool to Create Features. You can do this one by one or all at once.


1

Depend what means 'many holes', but if it's not hundreds/thousands you can always use Auto Complete polygon tool. All you have to do is start edit session, select the tool, draw the line across a hole and merge created polygons to required polygon. It is better than digitising and Trace but still semi manual… see screenshots: Select Auto complete tool and ...


0

You can start editing on the selected polygon and snap the new vertices to the boundaries of the polygons surrounding the hole, effectively increasing the "selected polygon" to the area contained by the hole. You will also have recalculate the area in the attribute table to update the entire area. This can be accomplished using the tools in the editor ...


0

I would edit the polygon layer. trace the missing polygon boundary. merge the selected polygon and the newly created one. screenshots edit Trace create a new feature using the autocomplete polygon tool. @ChrisL is correct... You can simply draw a line crossing one of the edges (justone single segment from one existing polygon into the ...


0

If you don't need the data from all columns, you can turn off the fields that you don't need and then export them. Those fields won't be part of the export and thus you won't exceed the record limit.


0

I am using the Merge Tool, to merge 2 shapefiles but not every data is merging. What could be the cause of that ? Could it be the fields from the attribute table ? or maybe the options in the Merge rules ? Both shapefiles have the fields (FID, Shape, ID) but one of them has 2 more fields (buffer distance and Orig Fid). Should be the number of fields exaclty ...


0

You could use free and open OpenStreetMap (OSM) data. They are licensed under Open Database License (ODbL). Open this URL for Baden-Württemberg: http://overpass-api.de/api/interpreter?data=(rel(62611);%3E;);out; and this one for Rhineland-Palatinate: http://overpass-api.de/api/interpreter?data=%28rel%2862341%29;%3E;%29;out; Open the files in Quantum GIS ...


2

Shapefiles use dBase databases, which do not support null values. Any null values in numeric fields are stored as 0 and strings as a blank space (regardless of software). If you want true null value support, you need storage format that is null capable (such as a file geodatabase). Alternatively, you can import the records that do have coordinates and ...


2

You have to change the layer style from single symbol to categorized or graduated. See this tutorial for further details: http://qgis.spatialthoughts.com/2012/02/tutorial-styling-vector-data-in-qgis.html


0

For a pure python solution, you can use os.path.isfile to check if the shapefile exists and is indeed a file. import os myfile = r'C:\temp\myshp.shp' if os.path.isfile(myfile): print "The file exists" # Do something


2

It sounds like you have a DEM and you want to augment the accuracy of that DEM with some elevation data you collected as points. That's totally possible but the process probably isn't as linear as you would like it to be. That is - you can't (to my knowledge) update the values of raster cells from vector points directly. You have to go through the process ...


1

Given the extreme apparent age of the data, it seems unlikely that the original data was WGS84. Just plotting it shows an 0.13 degree shift from even 1:15m coastline (ArcGIS 10.0 Data & Maps "country.sdc\country"): If you do update the coastline data, you'd likely need to identify all other geometry data and update them as well.


1

For future references, here is the solution I have came to after following the advices above. import shapefile as shp import matplotlib.pyplot as plt sf = shp.Reader("test.shp") plt.figure() for shape in sf.shapeRecords(): x = [i[0] for i in shape.shape.points[:]] y = [i[1] for i in shape.shape.points[:]] plt.plot(x,y) plt.show() The ...


-1

private Style createStyle2(FeatureSource featureSource) { SimpleFeatureType schema = (SimpleFeatureType)featureSource.getSchema(); Class geomType = schema.getGeometryDescriptor().getType().getBinding(); if (Polygon.class.isAssignableFrom(geomType) || MultiPolygon.class.isAssignableFrom(geomType)) { ...


0

FME by Safe Software also does this, rather easily -- you could use the trial if it's a short-term solution you're looking for. You would read from ESRI fgdb and write into KML, and can add whatever you need in-between (re-projection, KML stylings, etc). An unnecessarily lengthy FME tutorial for working with KML conversions: ...


1

I've also worked with another company out of Ontario called AGSI. Their database has FSA and LDU boundaries along with address points.


3

You can also use GDAL/OGR directly (which is what QGIS uses behind the scenes). It requires a special driver, but if you get it via OSGEO4W, that is included. Command line would look something like: ogr2ogr -f kml -select desired,attribute,fields outfile.kml infilegeo.gdb filegeolayername There are some kml-specific options too, see ...


1

Just in case you can't access QGIS, I've created three separate shapefiles and put them on dropbox. The projection of these shapefiles is EPSG:4326 https://dl.dropboxusercontent.com/u/71658964/miconesia.zip I used ogrinfo on the original file and it tells me the projection is EPSG:4326, I think, for example: ogrinfo -so FSM_adm_SBOC_PCRAFI.gdb state Had ...


1

OK, here comes the correct answer: Make sure that rgdal (version >= 1.0.4) is installed install.packages('rgdal') packageVersion('rgdal') [1] ‘1.0.4’ Make sure that gdal (version >= 1.11.0) is installed library(rgdal) getGDALVersionInfo() [1] "GDAL 1.11.2, released 2015/02/10" Make sure that gdal is compiled with Expat/OSM and SQLite support: ...


1

You need to convert your SpatialPolygons class to a SpatialPolygonsDataFrame class. For example: require(rgdal) require(rgeos) # Read shapefile shp = 'C:/temp/myshp.shp' myshp = readOGR(shp, layer = basename(strsplit(shp, "\\.")[[1]])[1]) # Read shapefile attributes df = data.frame(myshp) # Simplify geometry using rgeos simplified = gSimplify(myshp, tol ...


1

Coerce your object to the appropriate Spatial*DataFrame-class (Points/Lines/Polygons), e.g. for SpatialPolygons using as(x, "SpatialPolygonsDataFrame" ): R> l <- readWKT("LINESTRING(0 7,1 6,2 1,3 4,4 1,5 7,6 6,7 4,8 6,9 4)") R> x1 <- gSimplify(p, tol=10) R> class(x1) [1] "SpatialPolygons" attr(,"package") [1] "sp" R> x2 <- as(x, ...


1

I went to Properties -> CRS - Create Spatial Index Works now! Not sure if this is what @Vince meant but it worked. -- EDIT -- I spoke too soon. My problem was that I had imported a .csv that had some NaNs in the Eastings/Northings. These got replaced with 1s. Once I got rid of those I had no problem.


1

this may be old - and i'm likely way off base, but pretty sure i did this a few days ago with OGR to create a shapefile larger than 2Gigs (by checking memory usage during writing, it never seemed to exceed about 40 megs). so, it would be something like: drv = ogr.GetDriverByName('ESRI Shapefile') ds = drv.CreateDataSource('myshapefile.shp') lyr = ...


0

You can use rgeos and raster functions to accomplish this #### set up example data library(raster) library(rgeos) p1 <- rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20)) hole <- rbind(c(-150,-20), c(-100,-10), c(-110,20), c(-150,-20)) p1 <- list(p1, hole) p2 <- rbind(c(-10,0), c(140,60), c(160,0), c(140,-55), c(-10,0)) p3 <- ...


0

As @Mateo hinted you can use a spatial join to join attributes from one shapefile/feature class to another. Use the "Spatial Join" tool which can select a feature layer based on the location to another feature layer (assuming you have a license for the tool), you will probably want to choose the option for join one to many (assuming the polygons are your ...


1

You can't merge points to polygons, but certainly a spatial join will merge the attributes of the two, no? You can right click on the polygon layer and choose (in Arcmap) join. Then in the "VERY" top pulldown choose join based on location. Then choose the point file for the features to join. You can then choose to have all the nearest points joined ...


1

You can, just right-click on the field heading for the field you're interested in in the attribute table and click "Statistics". It will tell you the maximum, minimum, mean, and several other things for any numeric field. If you have certain rows selected, the statistics will be calculated for those rows only. However, doing that for a set of contour lines ...


2

You can download them directly from the state department for cartography as these are listed as open data. State Departement for Cartography and Geodesy - Open Data


1

This page https://osm.wno-edv-service.de/boundaries/ offers you all available boundaries from the openstreetmap project. For the states you mention, it is down to suburb level. Alternatively, http://www.gadm.org/country offers shapefiles down to Landkreis level for Germany.


1

Assuming you will follow a manual verification process, I can suggest you somewhat quick and dirty solution: First by using Feature Vertices To Points tool (Data Management Tools\Features\Feature Vertices To Points) with BOTH_ENDS option, generate start and end points of each line segment (be aware that each segment will be your unit of analysis); Second, ...


0

What you will need to do is outlined as below. Make sure your lines are connected at end vertices only (if they are not, use the Split Line At Vertices (Data Management) tool). Iterate your line features and create a list of pairs of lines which share end/start vertex. Use ObjectID as an unique line feature ID. You should have [(45,50),(50,52),(52,67)] by ...


2

Your code has too many brackets for one thing. I count three ( and two ). Fix that, and using file.choose() should work if the user chooses the .shp file. Note that: file.choose() only produces a dialog on Windows (I think) - on Linux its a text prompt. I don't know if it works in RStudio... The maptools functions readShape* usually fail to read ...


1

In a spatial database like spatialite this is a straightforward query. Suppose you have the polygons as parcels and the point layer is zoological (and both are spatial tables in spatialite). I'll assume the parcels has a unique id called parcel_id and the species has species_id as well as species_name and entity. The query would be something like: SELECT ...


1

You could try using Symetrical Difference as this, for me atleast, sometimes removes unwanted slivers if I receive them from the Difference tool. If not then you could try from QGIS: Eliminate Sliver Polygons (Vector > Geoprocessing Tools > Eliminate Sliver Polygons) Or from GRASS: v.clean (This is used to repair topology errors. Select the rmdangle ...


0

Have you looked into open street map (https://www.openstreetmap.org)? As far as I understand, they have the most updated vector data (boundaries etc) as it is continuously done on a voluntary basis from around the world.


1

It is probably possible with GDAL but not extremely easy. Everything that can be done with SQL in SpatiaLite can also be done with GDAL http://www.gdal.org/ogr_sql_sqlite.html and this query could be used as starting point: ogrinfo -dialect sqlite test.shp -sql "select attr, st_union(geometry) from test group by attr" However, the query creates one ...


1

This happened to me in QGIS. I managed to resolve the issue simply by deleting '_packed' from the file name, as someone has suggested in the comments section above.


2

Once you have loaded your shape file in qgis, right click on it in the legend, select save as, then select 'Keyhole markup language' as your format, spatial ref. sys. Must be set to epsg 4326. Then select a file path, where the kml will be saved. A little under this, theres an option export symbology. You should select the option 'export feature symbology'. ...


0

I have been down that route and I don't suggest it. When I started to run Arcobjects with Python (almost 2yrs ago), I only knew a little bit of C#, but had what I would consider a modest knowledge of Python. Not a pro, but not a beginner either. Now, I am switching the whole Add-In (3k-ish lines of code) to C# as it will be developed further and it's not ...


0

To accomplish this task, the overall work flow will be converting your lines to polygons. The FeatureToPolygon tool will only convert closed lines, so this will work well for limiting the lines you are working with. Next you'll want to remove all donut polygons from your analysis, which can be done with a cursor, checking if each geometry is multipart. You ...


0

Still having trouble converting SHP to GPX, had it work once and ever again. I created the name field (seen below) and copied the folder into my Garmanin 64 via copy and past but it shows up blank. The one time it worked was with random points, now I am trying to get it to work with a grid In the post above I checked skip attribute creation and forced gpx ...


0

Creating contours is an interpolation, which is why your output looks like it does. You need to reclassify using gdal_calc: http://www.gdal.org/gdal_calc.html But there is some good information here relating to reclassifying with either gdal or python: Reclassify rasters using GDAL and Python And then convert to vector using gdal_polygonize: ...


1

To "go through a designated folder, [and] locate all MXD files within the folder" is relatively easy with Python, and there is a Stack Overflow Q&A that describes some ways: http://stackoverflow.com/questions/3207219/how-to-list-all-files-of-a-directory-in-python However, the rest is much harder because ArcGIS Desktop 9.3 only had access to the ...


0

Convert your map to a SpatialPolygons object and then use gIntersection from the rgeos package. This clips your blue polygons exactly to the state boundaries. Inspired by this answer. library(rgeos) library(maps) library(maptools) mmap <- map('state', regions=c('maryland', 'virginia', 'delaware'), fill=TRUE) IDs <- sapply(strsplit(mmap$names, ":"), ...


0

Download the shapefile to the device. Make sure that your app has permission to read files from your storage: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> (having permission to write implicitly grants you this permission) Then, do something like: try { ShapefileFeatureTable shapefileFeatureTable = new ...


2

The ContractArea shapefile does not have any CRS information (.prj file is missing). So you better save it to another name, which will automatically create a .prj file. Then fill in the Clip tool dialogue like this: and you get the 4227 out of 13898 line features within the selected polygon.


1

Judging from the documentation, it looks like you should be able to right-click and hit Create Shapefiles. That is of course assuming you have the program integrated into the Windows shell. See the documentation for more information.



Top 50 recent answers are included