3
votes
1answer
36 views

shapefile record has no attribute named bounds

This is the code that I am using to print the bounds of my shapefile. import fiona import shapely import shapely.geometry fc = fiona.open("filename.shp") shapefile_record = fc.next() shape = ...
2
votes
0answers
31 views

Kartograph - AttributeError: _Shape instance has no attribute 'parts'

I am new to GIS and open source tools so bear with me. I am attempting to convert a shapefile to svg by running kartograph as a python module. My source file (provided by the local GIS ...
1
vote
1answer
59 views

How to create a shapefile or gml from a Oracle database using SDE.ST_Geometry?

I have a ORACLE database 10g(Oracle Database 10g Enterprise Edition Release 10.2.0.3.0) with a SDE.ST_Geometry field and i want to make a program in python so i can create several shapefiles based on ...
-3
votes
0answers
36 views

Exporting group layers from Table of Contents (TOC) to Folders of shapefiles?

I have some group layers in the Table of Contents (TOC). Each group of layers references a few shapefiles from different source folders. I would like to export each group layer name as a folder and ...
2
votes
3answers
62 views

How to find all distinct values from a single column of an attribute table with GDAL (Python)?

I am working with GDAL and modify ESRI shapefiles with it. I am searching a possibility how to find all distince values from a single column of an attribute table with GDAL (Python). In SQL it would ...
-3
votes
1answer
100 views

Exporting file geodatabase (GDB) to Folder of shapefiles?

I have a geodatabase with several feature dataset and feature classes associated with it. I want to export each feature dataset as folder and feature classes associated with each feature dataset will ...
2
votes
0answers
56 views

Identifying certain polygon from overlapping set

To clean up a large shapefile, I am looking for a way to do the following: I have the ID of many polygons which need getting rid of stored in a list. These polygons are villages and a second ...
0
votes
2answers
47 views

Parse PHP/HTML to shapefile or similar

I've been experimenting with scraping spatial data from a web page (www.majidata.co.ke). I've managed to find the source of the vector data from within a webpage though and have saved a chunk as HTML ...
1
vote
2answers
77 views

Vertical lines in a polygon shapefile

I am working with a GIS problem using a single input of a polygon shapefile. Consider an irregular polygon. I want to draw vertical lines across the extent of the polygon at equal spacing. How I ...
2
votes
1answer
69 views

Unicode Decode Error for shapefile in Python

I have Python script for converting shapefiles to Geojson. My code works well if I use some usa data, but when I want to use some other encoding, it gives me this error: Traceback (most recent ...
-1
votes
1answer
45 views

Displaying Shapefiles using Python? [closed]

I have some shapefiles, which I want to display in Python. Is there any code for that?
2
votes
0answers
32 views

Memory layer or QgsVectorFileWriter Error?

Currently this excerpt of code will not save to file (as it is supposed to). The memory layer is visable and editable. Yet even when manually saving the layer, any priorly added features ...
1
vote
0answers
12 views

Proper updating of new memory layer geometry?

Current workflow for a toolbar button: -create memory layer -save memory layer to shapefile Then the user uses the built-in QGIS tools to add geometry and finally saves changes via the auto prompt ...
0
votes
1answer
32 views

Adding a Vertex To Exisiting Feature(linear) Using OGR Python

I am working on a project that involves finding the intersection of linears in a shapefile, if that vertex(the found intersection) doesn't already exist for each(or one) of the features, then that ...
0
votes
1answer
65 views

40k+ points from Shapefile, clustering them and populating on Google Maps/Webapp

I just started a new Python/Django webapp job related to GIS (and i'm totally new to GIS). Here is my task and what i have found so far, and i am stuck as to finding out what's the best way or the ...
0
votes
0answers
41 views

how to create a shapefile containing attributes from a list?

I have a list of features and each feature is a dict in that list. following you can see the structure: [ {"FID": 0, "Shape": polyline, "Nodes": [0,1]}, {"FID": 1, "Shape": polyline, "Nodes": ...
0
votes
0answers
37 views

Exporting ArcSDE feature class to shapefile using OGR?

I'd like to export data from ArcSDE for SQL Server to SHP. I've tried first to run this python script in QGIS: http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_sde.py But finally I've got ...
2
votes
1answer
24 views

OGR DeleteDataSource not working properly in Python

I have a small Python script which is supposed to delete a shapefile in case the file is empty. import sys from osgeo import ogr drv = ogr.GetDriverByName("ESRI Shapefile") ds = drv.Open(inData) if ...
0
votes
0answers
37 views

Unable to load shapefiles fully using shapefile.py

I am trying to load my shapefiles directly via Python rather than loading them from Arc Catalog to ArcMAP. I load these modules first: import sys import os import arcpy import numpy Then I add a ...
0
votes
1answer
75 views

How to plot Storm Prediction Center (SPC) Shapefile using python

I am trying to make a plot of the SPC's thunderstorm outlook using Python. I have downloaded the shapefile from this website http://www.spc.noaa.gov/products/outlook/day1otlk.html. Then I use this ...
1
vote
1answer
48 views

how to separate a list of features from its shapefile_

I tried to copy all features in a list of dictionaries. the code looks as follows: def iterate_features(self): feature_set = arcpy.SearchCursor(self.address) for feature in feature_set: ...
1
vote
2answers
87 views

csv to shp python and formating a row

I´m doing a script to convert csv to shp, but I want to format one of the columns. It´s a string then I´d like to format like this a[8:10]+' / '+a[11:16]+' UTC' being a the value in the column. ...
0
votes
1answer
107 views

Creating records in output shapefile using Python

I have a list (output from a previous loop) containing attributes from an input shapefile. What I am stuck with is inputting those attributes to a new shapefile. I have plotted the point data using ...
0
votes
0answers
34 views

Copy queried attributes of a shapefile to a new shapefile [duplicate]

I have a polyline-shapefile, which I have successfully read into python using pyshp module. My problem is to save the 2nd node of every line feature into a separate, single point file. I have ...
1
vote
2answers
46 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
0
votes
2answers
77 views

creating many shapefiles from one multi-polygonal shapefile

Does anyone know of a way to create a standalone shapefile from every entry (row) in the attribute table of a large set of polygons (4909 in total)? preferably using python in a way that the results ...
0
votes
3answers
266 views

Calculating distance between points using ArcGIS Desktop?

I want to write Python syntax to calculate the distance from point to other points in the water network and so on for others, I have 21 points. I need distances have to follow the network That ...
-1
votes
1answer
67 views

Convert Road layer shapefile into a graph

I'm going to use Astar algorithm to find a path between two selected points.And I used the following code for that.Is there any way I could convert my Road Layer shapefile into a graph, which can be ...
0
votes
1answer
52 views

Change Attirbute Name (Fiona)

I have a shapefile that has 2 attributes named "X" and "Y". I want to change this to "Lon" and "Lat". My (limited) experience tells me that I should read in the original shapefile, preserve the ...
0
votes
1answer
149 views

Writing shapefile with projection defined crashes fiona

I've just started trying to use Fiona to write out shapefiles. I found the example code below, which seems to work fine from shapely.geometry import mapping, Polygon import fiona # Here's an example ...
4
votes
1answer
232 views

How to find the distance to the nearest coastline from a land-based latitude/longitude point?

I'm completely new to GIS and unsure what I need to solve this problem: In the image above turquoise is actually land. Sea is white. I tried using the NASA Distance to the Nearest Coast data dump ...
2
votes
3answers
156 views

convert a shapefile into graph with nodes and edges

Is there a way to convert a shapefile into graph with nodes and edges(except networkx). I'm using qgis and I want to convert a road vector layer into a graph, so that I can use it to apply shortest ...
0
votes
1answer
43 views

Add attributes to an output shapefile schema (via meta)

I am trying to copy the schema of an existing shapefile and add to it in an output shapefile. Somehow I am not getting anywhere with this...though the docs seem very clear (and the download page : ...
0
votes
1answer
60 views

Blank Shapefile output?

When executing the following command string in the active browser, Qgis projects the triangle polygon and associated attribute table correctly. Upon reopening the shapefile in a new browser, the ...
2
votes
0answers
95 views

Convert a classification image to aggregated polygon in shapefile using gdal/python

My goal is convert a 2D numpy array to shapefile. The matrix results from a classification, so the numbers have a meaning. I solved my problem, but the solution is somehow involuted and complicated. ...
1
vote
1answer
335 views

How to open a shapefile using Python in QGIS?

I have tried to open my shape files with the help of a tutorial (http://spatialgalaxy.net/2012/01/27/qgis-running-scripts-in-the-python-console/) but unfortunately I couldn't open my shapefiles for my ...
3
votes
2answers
104 views

A python tool like GNU's diff for shapefiles?

I often use the GNU diff tool to compare two files or even two folders for differences. I was wondering if there is a Python based tool out there that does basically the same for shapefiles? In the ...
0
votes
0answers
59 views

need help creating layer with geom type wkbGeometryCollection with gdal python

I am having trouble creating a layer with geom type as geometry collection. Thus I am unable to output to a shapefile. I have attached code below. dstLayer is null. This does not happen if geom type ...
0
votes
0answers
42 views

Problem reducing the width of the attributes fields of a shapefile using python

I have a shapefile with rather long attribute widths (which is resulting in a rather large file). I am trying to trim it in python, here is my code: layer = qgis.utils.iface.activeLayer() ...
0
votes
1answer
96 views

Select by attributes within the fiona Python module

Is it possible to select polygons from a shapefile based upon their attributes using the Fiona Python module? I can't seem to find anything in the docs, but it seems like a strange thing not to be ...
1
vote
2answers
84 views

Separating a shapefile into separate shapefile based upon their features using a python script [duplicate]

I have a shapefile of a US. I need to make an individual shapefile for all the states in the US using a python in ArcGIS. How can I do it?
3
votes
0answers
129 views

Why does the QgsVectorFileWriter have probelms creating vector files? [closed]

I am using QGis 2.0.1 and have tried to create a new GIS feature file (SQLite, Spatialite, and Shapefile) of a subset of the data. I am then saving a copy of the style of this layer and applying it to ...
0
votes
1answer
56 views

Selection/Deletion of all smaller polygon/s in a SHP - Python solution?

ArcMap 10.2 user, with Spatial Analyst only. No ArcServer or of sort. I have abt 500+ polygon shapefiles, each containing 2 or more polygons. All of them has a NAME column and the rest of the ...
2
votes
0answers
64 views

Identify different networks inside a line shapefile

I'm dealing with a quite big line shapefile containing road tracks. The roads are connected to each other, creating distinct networks. These networks are independent and they are not connected to each ...
2
votes
1answer
429 views

Problem creating point shapefiles programmatically using python in QGIS 2.2

I am trying to create a point shapefile in the memory buffer (for a temporary label) and then zoom to the extents on this buffer. The working (in version 2.1) test code for this is: def ...
1
vote
3answers
583 views

Python: How to create a Polygon Shapefile from a list of X,Y coordinates?

I have a list of X,Y coordinates from a csv file, that represent a polygon. I´m trying to create a Polygon-Shapefile from this list. I´ve been trying around and found a possbility to write the list to ...
1
vote
0answers
79 views

Where are dynamic hyperlinks stored?

A while back (ArcGIS 10.0 times, or maybe even 9.3) a colleague of mine created a mxd with a few hundred manholes and attached dynamic hyperlinks to them (pointing to photos of them). (I know this ...
1
vote
2answers
528 views

Creating a new feature class with python and then adding attibutes

I am having trouble adding rows to a shapefile after it has been created. I'm not sure if I need to create the shapefile in memory and add the data or creating then re-open the file. While I've ...
0
votes
0answers
81 views

QGIS and usage of ExportToKML()

I am trying to dump to a csv file the geometry (and attributes) of a shapefile, including a KML dump (using a python script as described in shp-to-csv) but I am unable to get the correct coordinates ...
0
votes
1answer
57 views

osm_id in a shapefile vs. the uid and id attributes in an OSM file

I'm parsing an OSM file using the Python package osmread. The entities parsed have the following attributes id, version, changeset, timestamp, uid, and tags. On the other hand, I have a shapefile, ...