Linked Questions
10 questions linked to/from Reading shapefile in Python
39
votes
5
answers
80k
views
Writing Shapely geometries to shapefiles
Can someone demonstrate a simple way to write geometry data-structures from shapely into shapefiles?
I am particularly interested in polygons with holes and linestrings. It would also be beneficial to ...
8
votes
1
answer
22k
views
Using Fiona to write a new shapefile from scratch
I am new to Fiona, and trying to wrap my head around reading a csv file and writing out an ESRI shapefile. I have most of it down, but am missing two things; (1) defining the projection/spatial ...
8
votes
2
answers
7k
views
better way to duplicate a layer using ogr in python?
I'm splitting a large shapefile into many smaller ones using ogr. I'd like to just copy all of the field and layer config information from the original. Here's how I'm doing it now:
src = ogr.Open('...
3
votes
1
answer
6k
views
Getting random coordinates based on country
Are there any webserveices/APIs that can take a country name and return a random coordinates (not including the sea/ocean sections) inside that country?
3
votes
1
answer
4k
views
Adding a Property (attribute) to a geometry in Shapely/Fiona
Once you have line and polygon geometries, intersection using Shapely is very straight forward. What I did after that is to integrate all the looped 'intersected' geometries into a MultiLineString.
...
0
votes
2
answers
4k
views
Vertical lines in a polygon shapefile [closed]
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
1
answer
172
views
Copy multiple shapefiles that intersect a polygon to a new location
I am trying to select and copy shapefiles from one folder to a new location based on if they intersect a polygon feature class. I am getting stuck in somewhere in the for loop.
EDIT: The goal is to ...
1
vote
1
answer
278
views
Custom datum transformation in Python
I need to transform a shapefile from Deir ez Zor / Levant Stereographic (EPSG:22780) to UTM 36N using 7-parameters Helmet transformation on Python script.
In ArcGIS, I can achieve the following using ...
1
vote
1
answer
78
views
Trouble Detecting State When Coordinates Near Coastline
Using Python I'm attempting to determine the state a coordinate pair resides within.
I've downloaded the US Census State And Equivalent dataset, extracted the shapefiles, and put them into Shapely ...
0
votes
0
answers
35
views
Using ogrinfo in Python to find specified information [duplicate]
I am using ogrinfo in Python to find out information about a shapefile
from subprocess import Popen, PIPE
args = ['ogrinfo', '-so', '-al', 'C:/test/test_shapefile.shp']
process = Popen(args, stdout=...