Tag Info

Hot answers tagged

6

The quickest way that I am aware of, is to use the Shapely library (requires the GEOS Engine, you can find a one-click installer for shapely here if you're on windows) The manual provides a dead-on example of what your question: >>> from shapely.geometry import Point >>> a = Point(1, 1).buffer(1.5) >>> b = Point(2, ...


5

It's probably easiest for you to create your own hexagonal grid shapefile. Many GIS have built-in tools for creating hexagonal grids of any desired resolution and orientation. For example, in the cross-platform and open-source GIS Whitebox GAT, for which I am a developer, you can use the Create Hexagonal Vector Grid tool to create a hex-grid shapefile for ...


4

Based on the conversation on the comments, ArcGIS online is making a guess at the coordinate system, while ArcMap is not. When it encounters an unknown coordinate system, ArcGIS Online appears to automatically assume WGS 1984. ArcGIS for Desktop treats undefined coordinate systems differently and does not make assumptions about the data's actual coordinate ...


4

The "Phantom" feature likely is an invalid one, you should try to make valid it. To fix the feature you can: use the Check Geometry tool (Vector->Geometry tools->Check Geometry Validity). This allows you to find invalid geometries. In this case you have to fix the feature manually by editing it. use the Processing LWGEOM plugin: ...


3

From the GDAL page for the Shapefile driver: SHPT_POLYGON shapefiles, reported as layers of type wkbPolygon, but depending on the number of parts of each geometry, the actual type can be either OGRPolygon or OGRMultiPolygon. So the answer to your question is YES ;-)


3

Shapefiles, which use the older dBase specs, do not support null values. If you must maintain null values and you have to keep the file format to shapefile, you'll need to use a representative or 'nodata' value for it. This can be any value you wouldn't normally encounter or expect to encounter in the data, or that even falls within valid data's range, such ...


3

Two other US government sites I use that provide similar (and in some cases duplicate I believe) datasets as those found on the National Atlas are: USGS Earth Explorer: http://earthexplorer.usgs.gov/ USDA Geospatial Data Gateway: http://datagateway.nrcs.usda.gov/


2

As PolyGo and Brad noted, StackExchange does not host data itself. For a global dataset of inland waterways, SRTM may be the best source readily available. Have you looked at a description of the data. It is actually quite good resolution considering the extent. If you are interested in coastlines and will be working at various scales I also recommend ...


2

fc.next() is a simple iterator: fc = fiona.open("my.shp") first_feature = fc.next() second_feature = fc.next() ... Or more simply: for feat in fiona.open("my.shp") print feat The result is a Python dictionary. For example with one result (feat=) {'geometry': {'type': 'Point', 'coordinates': (180627.0, 330190.0)}, 'type': 'Feature', 'id': '154', ...


2

The Petrosys plug-in for Petrel is able to directly export vector data including contours and fault information into a variety of GIS formats through the spatial data translator. One easy workflow is to create a quick map of the Petrel model surface and faults directly from Petrel project, right click on them and elect to export. The export support outputs ...


2

As commented by @jbchurchill and @user23715, I recommend checking your Output Coordinates setting under your Environments tab to see what it is set to. I/we do this because in the Point To Raster (Conversion) help it lists the Environments respected by that tool as being: Environments Compression, Current Workspace, Output Coordinate System, ...


2

You can use the Dissolve function on a column which contains attributes relating to a specific area. This should combine all separated polygons, such as those of Hawaii, into a single polygon.


2

Having written a shapefile reader for MapDotNet, I recommend following the dBase IV spec. Once you start opening files from many sources you will find odd discrepancies, for instance older versions of the PostGIS tools filled null numeric with *.


2

All of the vector formats supported by GDAL/OGR are listed here. With each driver, check out the creation options to control the output. These are passed to ogr2ogr using -dco and -lco flags. Good text-based output drivers include: CSV - be sure to use -lco GEOMETRY=AS_WKT to get the well-known text geometry GeoJSON GML KML LIBKML.


2

Looks like you may not have GDAL installed, ogr2poly.py will not work without it. Download either the 32-bit or 64-bit GDAL installers, depending on your system. You need to install the GDAL core, and then the GDAL Python bindings.


2

First you will need an iterator to go through your shape files, there are two methods I employ: Method One: a folder full of shape files: import arcpy, sys InF = sys.argv[1] arcpy.env.workspace=InF for fc in arcpy.ListFeatureClasses(): Method Two: a whole tree full of shape files: import sys, os, arcpy InFolder = sys.argv[1] for (path, dirs, files) ...


1

Yes this is a standard GIS shapefile. A shapefile is a bit of a misnomer as it contains between 3 and up to 10 parts. You have all the correct parts. You can install QGIS on ubuntu easy enough https://www.qgis.org/en/site/forusers/alldownloads.html It works on linux or windows, once installed you need to add a vector layer.. Use the this to add your data ...


1

Try to copy your shapefile into a new one with ogr2ogr and see if that helps. This QGIS issue is about phantom features http://hub.qgis.org/issues/11007. However, the problems described in the ticket appeared when opening shapefiles which were saved by QGIS with another program and not with QGIS itself. It will not hurt to try, though.


1

Join the tables together. Right Click on the point shapefile and join it with the line shapefile.


1

Lots of questions cause your question is too broad and subject is not as simple as it seems... Writing complete resolution for you could take few hours (!!!) so I'll only write down my line of thinking, it should give you direction which way to go. You have to achieve road network data to count routes... OSM should be good enough. Convert data into graph ...


1

What you are looking for is Geographic Markup Language (GML). It is human readable and should maintain everything. -f gml in gdal / ogr. Do not overlook KML either. Both are human readable vector OGC standards supported in gdal / ogr. You can open both in text editors.


1

To change projections with Fiona, use the pyproj module. Example with a point shapefile (you can simplify the algorithm): from pyproj import Proj, transform import fiona from fiona.crs import from_epsg shape = fiona.open('sample.shp') original = Proj(shape.crs) # EPSG:4326 in your case destination = Proj(init='EPSG:...') # your new EPSG with ...


1

Didn't try but the most obvious is where do you save your new file? Or why if you want to do 'in-place' change, you only open the shp file without changing the mode to be able to write it. Also more in general, use the with statement like in official docs because for example in your code, you do not close the file whereas with with it's automatic.


1

the str( ) will display the internal structure of your object str(zambiap) If you just want a data.frame to export: dt<-data.frame(1:length(zambiap)) zambiapd <- SpatialPolygonsDataFrame(zambiap, data=dt) If you want a meaningful data.frame, you need to get the data from the zambiap object. dt.f<-NULL for (i in 1:length(zambiap)){ ...


1

THe short answer is: I can;t see a way. However, changing attributes on a feature is time consuming at times (I have have a hard time figuring out why it happens). Thus, this should speed up your code a bit: pr.addAttributes( [QgsField(aName, QVariant.Double) ] ) attrs={} #------ # Add Values to Triangle Features in Values ...


1

SpatiaLite is one of the many potential solutions. It probably depends a bit on whether the shapefile you are working on is dynamic or its always the same file (or one of a few files of static content), but loading the shapefile using VirtualShape virtual table extension or the ImportSHP() SQL function will make it available in SpatiaLite. Then you can use ...


1

Using QGIS with the wanted features selected you can right click on the layer or go to the file menu and select "Save Selection as..." Choose Shapefile using the same projection as the original file. Done


1

Since you've already got a list of dicts, you can use Shapely (to manage the geometry) and Fiona (to write the shape file). from shapely.geometry import mapping from shapely.wkt import loads from fiona import collection schema = {'geometry': 'Point', 'properties': {'atribute1':'value', 'atribute2':'value'}} with collection("output.shp", "w", "ESRI ...


1

I'm going to answer the exact question you asked. If that isn't what you really meant, please update your question. Where from your website can I access worldwide vector water body shapefiles that have better resolution than the generic SRTM 90m data? You can't. This website (gis.stackexchange.com) is a Q&A site (per PolyGeo's comment on your ...


1

Indeed, the whole calculation is better done in excel, thanks for the attention anyway!



Only top voted, non community-wiki answers of a minimum length are eligible