Posted on December 8, 2009 by ragrawal
Tip 1: Importing DBF Files
shp2pgsql command is mainly to import shapefiles. However, it does come with an optional parameter -n that allows to import dbf files. You might need to install postgis in order to have shp2pgsql command.
/> shp2pgsql -n filename > outfile.sql
/> pgsql -h hostname -U username -d database -f outfile.sql
The above two commands [...]
Filed under: Database, Postgres, Tips, postgis | Leave a Comment »
Posted on December 8, 2009 by ragrawal
PostGIS usually raises “operations on mixed geometries” while trying to use topological functions (such as st_intersects, st_within, etc). There can be many different reasons because of which one might encounter this error. Below are the steps that I found useful in resolving this error.
1. Validate Geometries: Make sure all the geometries are valid. psql> [...]
Filed under: Database, Postgres, Tips, postgis | 1 Comment »
Posted on February 15, 2008 by ragrawal
When developing a web application, one has to be careful about the “character encoding”. There are many options such as latin1, utf8, etc, and the best character encoding depends on the language that your targeted audience use for writing. Since most web applications are required to handle all types of languages and, thus, are required to handle all different types [...]
Filed under: CakePHP, Database, MySQL, PHP, Web | Leave a Comment »
Posted on December 26, 2007 by ragrawal
Recently, I started working on a new project which uses postgres database and contains more than 3 million addresses. One of my first task was to geocode address. To do so, I wanted to sequentially access all the records ordered by address. As I never dealt with such a large database before, my first attempt was a [...]
Filed under: Database | Tagged: Cursor, PgSQL | 3 Comments »