[gdal-dev] GDAL question

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Tue Apr 20 08:25:48 PDT 2021


Hi,

Ogr2ogr by default converts all the columns so you should not need to do
anything. Test first ogr2ogr from the command line without mixing Python
into the soup. If you still do not get your "name" attribute converted you
may have something special in your data, like a few first features in the
GeoJSON missing the name attribute.

Do you really mean "wkt_geometry" or is it possibly "wkb_geometry"?

If you will still have troubles please share some test data.

-Jukka Rahkonen- 



Peter P wrote
> Hello
> 
> I use GDAL(https://github.com/OSGeo/gdal) with python bindings. I am
> importing GeoJSON to PostgreSQL (PostGIS). I know how to import only
> geometry to the table. I dont know how to import geometry with others
> columns to one table. I need to import geometry to "wkt_geometry" column
> and his name to "name" column.
> Can you help me please?
> 
> Here is how I import only geometry column:
> * ogr2ogr.main(["", "-f", "PostgreSQL", "-s_srs", * *"+proj=longlat
> +datum=WGS84 +no_defs", "-t_srs", "EPSG:3857", "PG:dbname='test'
> host='127.0.0.1' port='5432' user='user1' password='password1'", "-nln",
> "table1"])*
> 
> Thanks
> 
> Best Regards
> Peter
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list