bugra9 / gdal3.js

Convert raster and vector geospatial data to various formats and coordinate systems entirely in the browser.
https://gdal3.js.org
GNU Lesser General Public License v2.1
300 stars 45 forks source link

How to check srs #65

Closed phucnd1303 closed 5 months ago

phucnd1303 commented 5 months ago

Hi, I get an issue when processing .dxf file

gdal stderr: ERROR 1: Can't transform coordinates, source layer has no
gdal stderr: coordinate system.  Use -s_srs to set one.
gdal stderr: ERROR 1: Terminating translation prematurely after failed
gdal stderr: translation from sql statement.
gdal stderr: ERROR 10: Pointer 'hDS' is NULL in 'GDALGetFileList'.
gdal stderr:

I know this issue occurs because this file doesn't have srs, so how I can use gdal3 to check srs? I see gdal library we can get srs but in gdal3 I dont know how to get that to check null or not. Please help me

bugra9 commented 5 months ago

Hi @phucnd1303,

After opening the file, there is information about the dataset under datasets[].info. You can check the layers[].geometryFields[].coordinateSystem field.

image

phucnd1303 commented 5 months ago

Thank you so much! @bugra9