- Convert PDF to images (jpeg, png etc…)
- Adobe Air on Ubuntu Jaunty 9.04
- Speedup your flock browser (applied to firefox too)
- vmware-tools on Slackware 12.1
- Error with lxml on Debian Lenny
- Python File Manipulation (Excel, OpenOffice, Media, DBF, rar, gps, id3 …)
- Duplicate a website like Teleport on Ubuntu Jaunty Linux
- Uninstall / Delete Google desktop gadgets on Windows 7
Import Shapefiles (SHP) into Postgis
06/04/2009 // No comment // Category: My Everything // Thẻ: gis, gis, import, postgis, programming, shapefile, shp, shp2pgsql.Follow these steps to start importing ESRI Shapefiles into Postgis database
1. Generate SQL from the shapefile using shp2pgsql
shp2pgsql -W UTF-8 <file_name.shp> <schema>.<table_name> > <filename.sql>
ex:
shp2pgsql –W UTF-8 world.shp public.world > world.sql
2. Open the generated sql file, append “WITH OIDS” before “;” of the CREATE TABLE statement
3. Now import the sql file into Postgis, using psql command
psql -h <host_name> -U <user_name> -d <db_name> -f <file_name.sql>
ex:
psql -h 127.0.0.1 -U postgres -d world -f world.sql
4.Use Query tool available in PgAdmin3
CREATE INDEX <index_name> ON <table_name> USING gist (<spatial_attribute>);
VACUUM ANALYZE <table_name>
ex:
CREATE INDEX world_the_geom_gist ON world USING gist (the_geom);
VACUUM ANALYZE world
Leave a Reply
Recent Posts
Recent Comments
- Gilberto Ramos on Get back your Alt+Ctrl+Backspace in Karmic
- Venkat Mantirraju on Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
- vinay on Google App Engine & cron jobs
- Abhishek Ransingh on Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
- Makin on vmware-tools on Slackware 12.1
Blogroll
Gilberto Ramos: very useful! i was looking for this..!
Venkat Mantirraju: This is an excellent guide. Thanks a lot for your effort and time in making ...
vinay: i am testing it on my local appengine . created successfully a cron.yaml and its
Abhishek Ransingh: Hi All, I've done all the steps which has been mentioned above. But, when last ...
Makin: I am using Workstation 7 and trying to install vmware-tools on Slackware 13. It stops at ...
Install packages for PEAR in XAMPP (Ubuntu Linux)
17/03/2010
Skype on Ubuntu Lucid Lynx 10.04
17/03/2010
Hamachi on Ubuntu Karmic Koala 9.10 error
27/10/2009
Speedup your flock browser (applied to firefox too)
25/10/2009
Get back your Alt+Ctrl+Backspace in Karmic
18/10/2009
Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
| 12 comments
vmware-tools on Slackware 12.1
| 3 comments
Google App Engine & cron jobs
| 3 comments
Django, Mod-Python & CouchDB
| 2 comments
Mapnik installation on Slackware 12.1
| 2 comments
- © 2009 Tech Mix. All rights reserved.
- WPLine 1.0 designed by Hutek - A member of Vietnam Wordpress Commnunity.
- Powered by Wordpress. Work fine on almost popular browsers.

