h2gis icon indicating copy to clipboard operation
h2gis copied to clipboard

Support options on FILE_TABLE

Open ebocher opened this issue 2 years ago • 2 comments

FILE_TABLE engine permits to link file format to H2GIS database as dbf or shp. Often the shapefile format is distributed with a prj file which is not standardized and does not contain information to find the SRID code. However the SRID is used by the view GEOMETRY_COLUMNS to store geo metadata and the SRID is required by to build the corresponding CRS.

A simple solution to fix this problem will be to force the SRID via the FILE_TABLE function

CALL FILE_TABLE('/tmp/myshape.shp', 'tableName', options)

where options will be 'SRID=2154, ENCOCING=UTF8'

@nicolas-f

ebocher avatar Jan 20 '23 13:01 ebocher

Hello, Is it related to flatgeobuffer too ?

nicolas-f avatar Jan 20 '23 15:01 nicolas-f

Hello, Nope because the header of FGB contains informations about the CRS : https://github.com/flatgeobuf/flatgeobuf/blob/master/src/fbs/header.fbs

But options can be used to set other arguments than srid.. It's just an optional string with key=value.

ebocher avatar Jan 20 '23 15:01 ebocher