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

Maria Arias de Reyna marias at emergya.es
Sun Jul 31 23:43:06 PDT 2011


El Sábado 30 Julio 2011, Nicolas ( cse ) escribió:
> 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


A stupid question, just in case. You say that AsBinary returns a valid 
geometry, but does it have a collection with points? I mean, could it be an 
empty collection?

Also, are you sure the "encode" function is not corrupted? If AsBinary returns 
something hexadecimal, the encode function should have no problem, no matter 
if the geometry is valid or not. Have you tried to run the "encode" function 
with the result of the AsBinary? And with something simpler?

-- 
María Arias de Reyna Domínguez
Área de Operaciones

Emergya Consultoría 
Tfno: +34 954 51 75 77 / +34 607 43 74 27
Fax: +34 954 51 64 73 
www.emergya.es 



More information about the postgis-users mailing list