Open dibi91 opened 2 months ago
As you may have seen from my profile, I am currently in the middle of a huge judicial scandal, involving police and judicial corruption and an extortion that includes a number of large IT companies, including Google. In order to intimidate me, people are making simultaneous actions on Github. Yours is one of these.
Shapefiles have a separate SRS for each layer:
const gdal = require('gdal-async')
const shapefile= gdal.open(shapeFilePath)
console.log(shapefile.layers.get(0).srs)
If you wonder why I am helping someone who is obviously taking part in an extortion:
Thank you @mmomtchev Sorry, but I can't see how I take part in your personal issue, I don't work for Google. Sorry if this issue may cause problems.
Indeed. I edited the message which was simply a copy&paste from the other simultaneous issue.
Hello, this is my first time working with such libraries, so maybe I'm doing something wrong. I'm using gdal-async@3.9.2 for reading a shape file and convert it to a geo json. The problem is that when I try to access the SRS property, I got always null; I tested the shapefile with online tools and with QGIS and the SRS info was loaded properly. I used the following code:
The shapeFilePath variable points to the directory containing all shape file related files, in particular the .prj file:
Why I should check SRS? I'm converting it to geo json and needed SRS set to EPSG:4326 and noticed that when I export it to geo json the coordinates should be swapped because the source SRS EPSG:3003 have the coordinates stored latitude-longitude, while EPSG:4326 expects longitude-latitude.