[postgis-users] How to reproject postgis layers in mapserver

Obe, Regina DND\MIS robe.dnd at cityofboston.gov
Mon May 9 07:58:36 PDT 2005


I'm using mapserver 4.4.2 and PostGIS 8.0.2/1.0.0/proj 4.4.9.  I have aerial
tiles of MrSID files in NAD 83 meters  and my postgis layers in NAD 83 ft.
If I have my map in NAD 83 ft most works fine - I can zoom in out etc. and
its fairly fast.  My aerial reprojects correctly to NAD 83 ft.  

If I perform a query something like
qstring=parcel_id=blahblahblah&qlayer=parcels in my htm file 
 - then my aerial layer gets all screwed up - it doesn't seem to reproject
correctly. It takes a long time to run and then the whole aerial seems to
get squashed at the center of the zoomed in parcel.  If I leave the aerial
out - the query works fine.

If I switch my map projection to NAD 83 meters, then the postgis layers
don't seem to reproject so they just don't show or show in very weird
places.

I'm assuming this is something wrong I'm doing with the postgis layers
because if I swap these with map info tab files or shape files of NAD 83 ft,
those seem to work fine and project if I put in a PROJECT END clause.  I
tried putting in a PROJECT  END .. in the postgis layers, but that didn't
seem to make a difference.  I verified that my spatial fields are in the
geometry_columns table.

Below is a snippet of some of my mapfile
 CONFIG PROJ_LIB "E:\DNDIntranet\mapserv\scripts\proj\"
 CONFIG GDAL_DRIVER_PATH "E:\DNDIntranet\mapserv\scripts\fw\gdal_plugins\"
 NAME REMSPROP
 #meters EXTENT  225033.887 885954.489 245303.531 905462.069
 EXTENT  738152.213543900 2907686.126484261 797440.9488538101
2970773.30444638
 SIZE 500 500
 SHAPEPATH "F:\Mapservdata"
 UNITS feet
 SYMBOLSET symbols/symbols35.sym
 FONTSET symbols/fonts/font.lst
 IMAGETYPE jpeg
 TEMPLATEPATTERN "printable.html|loader.html|blankloader.htm"
 PROJECTION
  "init=epsg:2249"
  #"init=epsg:26986"
 END

 LAYER
  NAME "bosaerial2001"
  STATUS DEFAULT
  TILEINDEX "bostonsidtiles.shp"
  TILEITEM "Location"
  MINSCALE 300
  MAXSCALE 5000
  TYPE RASTER
  PROJECTION
    "init=epsg:26986"
  END
  PROCESSING "COLOR_MATCH_THRESHOLD=6"
  PROCESSING "SCALE_1=0,255"
  PROCESSING "SCALE_2=0,255"
  PROCESSING "SCALE_3=0,255"
 END

	LAYER
		NAME "neighborhoods"
		CONNECTIONTYPE postgis
		DATA "the_geom from neighborhoods"
		CONNECTION "user=propuser dbname=dnddts host=localhost"
		# PROJECTION
			#AUTO
		# 	"init=epsg:2249"
		# END
		TYPE POLYGON
		STATUS default
		CLASS
			OUTLINECOLOR 30 0 0
		END
	END
	
	LAYER
	  NAME "parcels"
	  CONNECTIONTYPE postgis
	  DATA "the_geom from landparcels USING UNIQUE parcel_id"
	  CONNECTION "user=propuser dbname=dnddts host=localhost"
	  STATUS DEFAULT
	  TYPE POLYGON
	  MAXSCALE 5000
	  CLASS
		NAME "Parcel Footprint"
		OUTLINECOLOR 100 100 200
		LABEL
		  POSITION CL
		  SIZE MEDIUM
		  COLOR 0 150 0
		END
	  END
	  TEMPLATE loader.html
	END



More information about the postgis-users mailing list