Linked Questions

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 ...
terra_matics's user avatar
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 ...
MfM's user avatar
  • 81
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('...
user2076663's user avatar
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?
Arya's user avatar
  • 141
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. ...
Akhil's user avatar
  • 1,445
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 ...
Akhil's user avatar
  • 1,445
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 ...
axman2's user avatar
  • 63
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 ...
Ali J. Ghandour's user avatar
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 ...
mmcclannahan's user avatar
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=...
fuzzy_raster9873's user avatar