<div>Hi Leonardo,</div>
<div> </div>
<div>I suspect that when you placed the shapefile into PostGIS, you may not have set the SRID value:</div>
<div> </div>
<div>shp2pgsql ...... -s 26910 .... </div>
<div> </div>
<div>Try a DATA string something like this:</div>
<div> </div>
<div> DATA "the_geom from (SELECT * from mylayer) as foo using unique gid using SRID=26910"</div>
<div> </div>
<div>... use the SRID number appropriate for you.<br> </div>
<div>Cheers,<br>Ken Lord</div>
<div>Vancouver BC<br> </div>
<div><span class="gmail_quote">On 8/11/05, <b class="gmail_sendername">Leonardo Lamarca</b> <<a href="mailto:lamarca@acquasoftware.com.br">lamarca@acquasoftware.com.br</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi everyone!<br><br>I need a help! I am running Mapserver 4.6.0 in Linux with PostgreSQL<br>7.4.5 and Postgis
1.0.3<br>I am trying to run my first web-map application using Postgis. When I<br>call de mapfile, MapServer return this error below.<br><br>I have an web-map application running with shape files. I converted<br>these shape files to PostgreSQL using shp2pgsql and change mapfile to
<br>connect and get data through PostgreSQL.<br><br>Regards,<br>Leonardo Lamarca<br><br>=========================================================<br><br>msDrawMap(): Image handling error. Failed to draw layer named 'uf'.<br>
prepare_database(): Query error. Error executing POSTGIS DECLARE (the<br>actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT<br>REGIAO::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text<br>
from public.br_uf WHERE the_geom && setSRID('BOX3D(-79.1998333333333<br>-33.751,-27.1691666666667 5.272)'::BOX3D, find_srid('','public.br_uf<br>','the_geom') )'<br><br>Postgresql reports the error as 'ERROR: find_srid() - couldnt find the
<br>corresponding SRID - is the geometry registered in the GEOMETRY_COLUMNS<br>table? Is there an uppercase/lowercase missmatch? '<br><br>More Help:<br><br>Error with POSTGIS data variable. You specified '<check your .map file>'.
<br>Standard ways of specifiying are :<br>(1) 'geometry_column from geometry_table'<br>(2) 'geometry_column from (<sub query>) as foo using unique <column<br>name> using SRID=<srid#>'<br><br>Make sure you put in the 'using unique <column name>' and 'using SRID=#'
<br>clauses in.<br><br>For more help, please see <a href="http://postgis.refractions.net/documentation.php">http://postgis.refractions.net/documentation.php</a><br><br>Mappostgis.c - version of Jan 23/2004.<br><br>================================================================
<br><br>Part of my mapfile:<br><br><br>MAP<br> NAME "my2ndmap"<br> EXTENT -73.991 -33.751 -32.378 5.272<br> FONTSET "fontset.txt"<br> IMAGETYPE PNG<br> #SHAPEPATH "mapas"
<br> SIZE 600 450<br> SYMBOLSET "symbolset.sym"<br> STATUS ON<br> UNITS DD # sim. é necessário especificar a unidade de<br>medida usada pelo MAP->PROJECTION<br>
<br> #~ PROJECTION<br> #~ "init=epsg:4291" # <4291> +proj=longlat +ellps=GRS67<br>+towgs84=-57,1,-41,0,0,0,0 no_defs <><br> #~ END<br><br> WEB<br> IMAGEPATH "/var/www/html/my2ndmap/tmp/"
<br> IMAGEURL "/my2ndmap/tmp/"<br> MINSCALE 25000<br> MAXSCALE 35000000<br> TEMPLATE "web_template.html"<br> HEADER "web_header.html"
<br> FOOTER "web_footer.html"<br> LOG "/var/www/html/my2ndmap/log"<br> END<br><br> QUERYMAP<br> COLOR 0 0 255<br> SIZE 300 225
<br> STATUS ON<br> STYLE HILITE<br> END<br><br> LEGEND<br> IMAGECOLOR 255 255 255<br> POSITION UR<br> KEYSIZE 12 10<br> STATUS ON
<br> LABEL<br> ANTIALIAS TRUE<br> SIZE SMALL<br> TYPE BITMAP<br> COLOR 0 0 0<br> END<br> END<br><br> REFERENCE<br> COLOR -1 -1 -1
<br> EXTENT -73.991 -33.751 -32.378 5.272<br> IMAGE "br_refmap.png"<br> MAXBOXSIZE 119<br> OUTLINECOLOR 255 0 0<br> SIZE 120 90
<br> STATUS ON<br> END<br><br> SCALEBAR<br> COLOR 255 0 0<br> INTERVALS 3<br> OUTLINECOLOR 0 0 0<br> POSITION LR<br> SIZE 200 3
<br> STATUS EMBED<br> STYLE 0<br> UNITS KILOMETERS<br> LABEL<br> ANTIALIAS TRUE<br> SIZE SMALL<br> TYPE BITMAP
<br> COLOR 0 0 0<br> END<br> END<br><br><br> LAYER # uf<br> #~ PROJECTION<br> #~ "init=epsg:4291" # <4291> +proj=longlat +ellps=GRS67<br>+towgs84=-57,1,-41,0,0,0,0 no_defs <>
<br> #~ END<br> NAME "uf"<br> DEBUG on<br> CONNECTIONTYPE postgis<br> CONNECTION "user=[*******] password=[*******] dbname=gis_teste01<br>host=localhost"
<br> TYPE POLYGON<br> DATA "the_geom from public.br_uf "<br> STATUS DEFAULT<br> CLASSITEM "REGIAO"<br> CLASS
<br> NAME "Norte"<br> EXPRESSION "NORTE"<br> OUTLINECOLOR 46 92 92<br> COLOR 0 192 0<br> END<br> CLASS<br>
NAME "Nordeste"<br> EXPRESSION "NORDESTE"<br> OUTLINECOLOR 46 92 92<br> COLOR 192 192 192<br> END<br> CLASS
<br> NAME "Centroeste"<br> EXPRESSION "CENTROESTE"<br> OUTLINECOLOR 46 92 92<br> COLOR 255 128 128<br> END<br> CLASS
<br> NAME "Sudeste"<br> EXPRESSION "SUDESTE"<br> OUTLINECOLOR 46 92 92<br> COLOR 255 255 128<br> END<br> CLASS
<br> NAME "Sul"<br> EXPRESSION "SUL"<br> OUTLINECOLOR 46 92 92<br> COLOR 128 128 255<br> END<br> END<br><br>(....)
<br></blockquote></div><br><br clear="all">