Tigerline data Imported to postgis and TEXT LABEL

William E Reid wer at CSTONE.NET
Tue Aug 2 14:49:29 EDT 2005


Greetings,

GDAL 1.2.1.0, released 2004/06/23

MapServer version 4.2.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER 
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=POSTGIS 
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

PostgreSQL 7.4.6

I have noticed that ogr2ogr will import tigerline data using 'character' 
types for some of the columns.

When doing normal selects (ex: where fename = 'teststreet')  I have two 
choices:
where fename like 'teststreet%'
or
where trim(fename) = 'teststreet'.

Same goes for toaddr, fraddr, fedirp etc... Basically, anywhere I would 
  want to see varchar(X) used, character(x) is used so trim() or % are 
needed.

Mapscript will gladly display TEXT defined in my LABEL object, but it 
does not trim the spaces (I am assuming because postgres treats 
characters as (X length) strings without termination.

So I end up with labels that take up a lot of real estate especially 
when displaying [toaddr]-[fraddr] as an example each being defined as 
character(11) (right justified?!).

I can modify my columns and fix the problem (create column with new 
type,copy data, move column, remove column....), but I was really hoping 
to stay with generic tigerline data and whatever ogr wants it to be when 
converted to postgis.  I am trying to cut back on the already large task 
of updating/creating/indexing what I consider to be large amounts of data.

Some of this question belongs to ogr2ogr but the remainder (displaying 
of labels) I wander about in mapserver.  Any little tidbits of thought 
out there for my TEXT field and dealing with extra spaces returned from 
postgis/ogr2ogr?

It could also be done efficiently through postgres with a cast, but as I 
watch the statements coming from mapserver (and learn a bunch too), I 
would not begin to want to throw and extra implicit cast in there.  Also 
I didn't really want to add a regex for each TEXT label.


Do most of you guys (in the states) end up using Tigerline data or do 
you get it somewhere else?  Do you roll your own tables for everything 
anyway?



Thanks for all the Maps.  I dig it.  Mapserver has been a  really useful 
tool for us.

-=Bill



More information about the mapserver-users mailing list