Python - Creating a shapefile from a bounding box coordinates list [closed]

I have a point Lat, Long coordinate i.e. Lat= 10 and Long = 10. I want to create a shapefile of a 0.5 degree bounding box around this point, so the bounding box should be as follow:

1. minimum Long= 9.75
2. minimum Lat = 9.75
3. maximum Long = 10.25
4. maximum Lat = 10.25

Does anyone knows how to do that in Python without GIS software?

I have no ESRI or QGIS. I thought that it would be possible to create a shapefile using bounding box coordinates with Python. The only info I have are the coordinates of the bounding box. I try using pyshp package pypi.org/project/pyshp but it is not obvious how should I proceed.

• What have you already tried? in which GIS Software you want to use the tool? Jan 31 '19 at 14:56
• There are already a few questions with good answers. Here's one for ESRI, and one for QGIS. Both provide solutions with python and could be adapted to newer versions. Jan 31 '19 at 15:06
• I think my question is unclear. I have no ESRI or QGIS. I thought that it would be possible to create a shape file using bounding box coordinates with python. The only info I have are the coordinates of the bounding box. Jan 31 '19 at 15:07
• I try tio find a way using pyshp package pypi.org/project/pyshp but it is not obvious how should i proceed Jan 31 '19 at 15:08

Well, at least this worked for me, following the Docs (which seem a bit outdated to me) and using the internal module documentation:

import shapefile as shp
from osgeo import osr

centroid_x = 10.
centroid_y = 10.
target_epsg = 4326
dst_file = r'd:\working\testing\test.shp'

w = shp.Writer()
# assign POLYGON (5) as shapeType
w.shapeType = 5
# add a "name" field of type "Character"
w.field('name', 'C')
# coordinates in clockwise rotation