Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to visualize PostGIS Geometry column as an overlay of a Leaflet tiled Map. I started a question here ,but didn't get any simple and satisfied answer. So I am starting this question. I got an option on Github to convert the PostGIS column to GeoJSON which can be visible through leaflet map.

I used the url as follows


but it returns the following errors

Notice: Undefined index: parameters in C:\wamp\www\pgsql\PostGIS_GeoJSON.php on line 52

Notice: Undefined index: orderby in C:\wamp\www\pgsql\PostGIS_GeoJSON.php on line 54

Notice: Undefined index: limit in C:\wamp\www\pgsql\PostGIS_GeoJSON.php on line 61

Notice: Undefined index: offset in C:\wamp\www\pgsql\PostGIS_GeoJSON.php on line 63

Warning: pg_query() []: Query failed: ERROR: function transform(geometry, integer) does not exist LINE 1: SELECT *, st_asgeojson(transform(geom,4326)) AS geojson FROM... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in C:\wamp\www\pgsql\PostGIS_GeoJSON.php on line 89
An SQL error occured.

What I have to do?

share|improve this question
up vote 1 down vote accepted

The code you are using uses the older function naming style without the "ST_" prefix, used many many years ago. So transform(geometry, integer) is now ST_Transform(geometry, integer).

There are a few things you can do to fix this. Do one of these:

  • Fix the PHP code, by changing transform to ST_Transform
  • Apply the legacy.sql enabler script from the PostGIS contrib directory (documented here)
share|improve this answer
Thank you very much for your reply. Can you explain little more how to enable legacy.sql script from PostGIS contrib directory? – Devils Dream Jan 7 '13 at 6:36
@DevilsDream updated answer. You will need to locate the legacy.sql for your system (it depends on what you have installed). – Mike T Jan 7 '13 at 7:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.