[postgis-users] Mapserver with postgis, sql query error.

James David Smith james.david.smith at gmail.com
Sat Jul 30 07:22:26 PDT 2011


Hey Nicholas,

I'm a newbie, but just to say that I've used the 'Spit' tool within
QGIS to load shapefiles into PostGIS - mght be worth a look. You can
also then load the table into QGIS once it is in the system to see if
it has stored it correctly?

James

On 30 July 2011 15:17, Nicolas ( cse )
<nicolas.machado at codigosudeste.com.ar> wrote:
> Hi,
> I'm a newby with this.
> I have a shape file that I upload to postGis Database, with the windows
> program "postgis and dbf loader".
> Then I create a test with MS4W environment.
> I setup a LOG in the map file.
> And the error y following:
> <code>
> [Sat Jul 30 01:45:34 2011].750000 CGI Request 1 on process 4620
> [Sat Jul 30 01:45:34 2011].750000 msDrawMap(): WMS/WFS set-up and query,
> 0.000s
> [Sat Jul 30 01:45:34 2011].906000 msPostGISLayerWhichShapes(): Query error.
> Error (ERROR:  geometry requires more points
> ) executing query: select
> encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex') as
> geom,"gid" from t_parcelas where the_geom &&
> GeomFromText('POLYGON((5600615.254754 5725111.70807103,5600615.254754
> 5739818.70784397,5620240.983548 5739818.70784397,5620240.983548
> 5725111.70807103,5600615.254754
> 5725111.70807103))',find_srid('','t_parcelas','the_geom'))
> [Sat Jul 30 01:45:34 2011].906000 msDrawMap(): Image handling error. Failed
> to draw layer named 'Parcelas'.
> [Sat Jul 30 01:45:34 2011].906000 msFreeMap(): freeing map at 01DBAD80.
> </code>
>
> This is the layer section in the map file
> <map>
> ...
>  LAYER # States polygon layer begins here
>     NAME         Parcelas
>     CONNECTIONTYPE postgis
>     CONNECTION "user=postgres password=postgres dbname=muni_gis"
>     DATA "the_geom from t_parcelas"
>     STATUS       DEFAULT
>     TYPE         POLYGON
>     PROJECTION
>       "init=epsg:4221"
>     END
>   END # States polygon layer ends here
> </map>
> The table is populated, everything looks fine, but I can't see any map.
>
> Then I enter the SQl Query in the SQL Window of pgAdmin III, and start to
> rewrite this sql query:
> select encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex')
> as geom,"gid" from t_parcelas where the_geom &&
> GeomFromText('POLYGON((5600615.254754 5725111.70807103,5600615.254754
> 5739818.70784397,5620240.983548 5739818.70784397,5620240.983548
> 5725111.70807103,5600615.254754
> 5725111.70807103))',find_srid('','t_parcelas','the_geom'))
> With thi error:
> ERROR:  geometry requires more points
> ********** Error **********
> ERROR: geometry requires more points
> SQL state: XX000
>
> If I extract function AsBinary, there is no error:
> Total query runtime: 9625 ms.
> 67354 rows retrieved.
>
> Here is my question:
> 1) How to check if the data is correct ?
> 2) do I have lo load data with shp2pgsql command line utility?
> 3) any idea ?
> Best Regards.
> Nicolas
> --
>
> _______________
> .:Nicolás Machado
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list