By custom, I don't mean a different structure of KML file, but in
section, I have data with HTML tags of this kind:
New York City
Attributes
CITY_ID 150335
POPULATION 8244910
AREA 468.48
]]>
40.712964,-74.003886,0
I want to easily import all this data, for each placemark, to a table with corresponding columns in the database, how to do this?
Answer
you can use ST_GeomFromKML as this page.
SELECT ST_GeomFromKML('
-71.1663,42.2614
-71.1667,42.2616
');
or you can use ogr2ogr as following to process entire KML files;
ogr2ogr -f "PostgreSQL" PG:"host=yourhost user=youruser dbname=yourdb
password=yourpass" inputfilename.kml
i hope it helps you...
No comments:
Post a Comment