I have a Web API that creates a shapefile on demand for the user to download over the browser. The geometries are all points and in WGS84 projection. I'm running into an issue where the ogr2ogr is throwing this error when I apply a transform to it:
Can't transform coordinates, source layer has no coordinate system. Use -s_srs to set one.
My question is how do I correctly create the shapefile so ogr2ogr can at correctly guess which coordinate system I'm using. Because I'm not saving the files to disk, I'm actually building the byte array of the .shp file following the shapefile technical description ESRI Shapefile Technical Description
If I use -s_srs or -a_srs to manually assign it with SRID 4326, then ogr2ogr will work.
EDIT: in response to iant's comment, I do have the .prj file in the same directory as the .shp file and they share the same filename.