Hi Fran,<br><br>many thanks for sheding some light on how gvSIG reads PostGIS geometry types.<br>Yesterday I used the PostGIS function ST_DUMP to "explode" all multilines to create a nice Linestring layer ( I do need simple lines for analysis purposes anyway) et voila! gvSIG lets me choose the geometry column from the listbox and nicely shows all the simple lines.<br>
I like it!<br>My problem resulted from not being picky about Multipolygons in the very beginning as I clipped lines with those polygons within PostGIS. So I produced multilines and lines as well which then caused the troubles in displaying them in gvSIG.<br>
Exporting this layer to shp file directly from PostGIS produced LINE2D as geometry type which was perfectly read by gvSIG concealing my inaccurateness<a href="http://dict.leo.org/ende?lp=ende&p=5tY9AA&search=inaccurateness"><b></b></a>.<br>
"Remember to think twice" as Jacko used to sing <img goomoji="gtalk.330" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:gtalk.330@goomoji.gmail"><br><br>Thanks again!<br><br>Johannes<br><br><div class="gmail_quote">
2009/10/14 Francisco José Peñarrubia <span dir="ltr"><<a href="mailto:fjp@scolab.es">fjp@scolab.es</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Hi Johannes.<br>
<br>
The supported geometry types in PostGIS gvSIG's drivers are:<br>
<br>
case POINT2D:<br>
aux = "<b>POINT</b>";<br>
break;<br>
case LINE2D:<br>
aux = "<b>MULTILINESTRING</b>";<br>
break;<br>
case POLYGON2D:<br>
aux = "<b>MULTIPOLYGON</b>";<br>
break;<br>
case MULTI2D:<br>
aux = "<b>GEOMETRY</b>";<br>
break;<br>
case MULTIPOINT:<br>
aux = "<b>MULTIPOINT</b>";<br>
break;<br>
<br>
<br>
If you need to mix LINESTRING and MULTILINESTRING, I advice you to set
geometry type to MULTILINESTRING always, although GEOMETRY will be ok
also, but then your layer will be treated like a DXF, DGN or DWG
(multiple types of geometries).<br>
More info about adding geometry columns in PostGIS:<br>
<a href="http://postgis.refractions.net/documentation/manual-1.3/ch06.html" target="_blank">http://postgis.refractions.net/documentation/manual-1.3/ch06.html</a><br>
(You can try this function: <span>Probe_Geometry_Columns()).</span><br>
<br>
But I think this shouldn't be the problem. What is the name of your
layer?.<br>
The code to select geometry fields in Postgis gvSIG driver is this:<br>
<br>
String[] tokens = table_name.split("\\u002E", 2);<br>
String sql;<br>
if (tokens.length > 1)<br>
{<br>
sql = "select * from GEOMETRY_COLUMNS WHERE F_TABLE_SCHEMA
= '"<br>
+ tokens[0] + "' AND F_TABLE_NAME = '" +<br>
tokens[1] + "'";<br>
}<br>
else<br>
{<br>
sql = "select * from GEOMETRY_COLUMNS" +<br>
" where F_TABLE_SCHEMA = current_schema() AND F_TABLE_NAME
= '" + table_name + "'";<br>
<br>
}<br>
<br>
ResultSet rs = stAux.executeQuery(sql);<br>
while (rs.next())<br>
{<br>
String geomCol = rs.getString("F_GEOMETRY_COLUMN");<br>
list.add(geomCol);<br>
}<br>
rs.close(); stAux.close();<br>
<br>
<br>
<br>
This means that you can't use the character "." (period) in your table
name. Otherwise, it will be treated as your schema (for example,
public.tablename).<br>
<br>
Hopes it helps. Please, if you find the problem, let us know... I'm
curious :-)<div class="im"><br>
<br>
Fran Peñarrubia<br>
<a href="http://www.scolab.es" target="_blank">www.scolab.es</a><br>
<br>
<br></div>
Johannes Valenta escribió:
<blockquote type="cite"><div><div></div><div class="h5">Hi list,<br>
<br>
after examining my postgis-layer more carefully I found out that I
mixed up Linestrings and Multilinestrings.<br>
This probably caused all the trouble as gvSIG does not know how to
handle this mix.<br>
Well, I am cleaning my layer...<br>
Thanks all!<br>
<br>
Johannes<br>
<br>
<div class="gmail_quote">2009/10/13 Johannes Valenta <span dir="ltr"><<a href="mailto:spatialjoe@googlemail.com" target="_blank">spatialjoe@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi Fran, hi Vladimir,</div>
<div> </div>
<div>thanks for the input. </div>
<div>I think Fran is right with changing the fieldname "length" to
something else.</div>
<div>I ruled out any typos and also the table name should be no
problem.</div>
<div>My server is not public and I will have a look at my database
in the evening.</div>
<div>
<div>Regarding the geometry_columns table in Postgis everthing is
fine.</div>
<div> </div>
</div>
<div>Many thanks so far,</div>
<div> </div>
<div>Johannes<br>
</div>
<div class="gmail_quote">2009/10/13 Vladimir Peric <span dir="ltr"><<a href="mailto:vladimir.peric@beogis.com" target="_blank">vladimir.peric@beogis.com</a>></span>
<div>
<div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I had the same problem and here is what solved the problem in my case.
In order GvSig to recognize the table as a layer candidate, there
should exist a table in PostreSQL, named <b>geometry_columns</b>. For
each table in the database that has a geometry column, a corresponding
row in the table <b>geometry_columns</b> should be present. The row in
this table can be manually added if needed.<br>
<br>
Hope this will help.<br>
<br>
Cheers,<br>
Vladimir
<div>
<div><br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">On Tue, Oct 13, 2009 at 9:22 AM,
Johannes Valenta <span dir="ltr"><<a href="mailto:spatialjoe@googlemail.com" target="_blank">spatialjoe@googlemail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi Virginia, <br>
thank you for responding. I am not able to choose the geometry column
within the listbox - it just stays blank. That's the problem.<br>
What could be the reason?<br>
</div>
<div>Best,</div>
<div> </div>
<div>Johannes<br>
<br>
</div>
<div class="gmail_quote">2009/10/13 virginia morales segura <span dir="ltr"><<a href="mailto:morales_vir@gva.es" target="_blank">morales_vir@gva.es</a>></span>
<div>
<div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Hi
Johannes,<br>
<br>
you must can to choose your geometry column at listbox of geometry. If<br>
you say that you have the column type geometry, you should choose it.<br>
Can you send us the layer that goes wrong.<br>
<br>
Regards.<br>
<br>
<br>
Johannes Valenta escribió:<br>
<div>
<div>> Hi list,<br>
><br>
> today I encountered a strange phenomenon. I tried to load a<br>
> postgis-layer into projects of both versions (1.1.2, 1.9 build1245)<br>
> which did not work.<br>
> In both versions the geometry column would not show up in the<br>
> corresponding field although I registered the layer in the
"geometry<br>
> columns" table in postgis as usual.<br>
> All other layers within my database work fine.<br>
> These are the columns of my layer:<br>
> pid integer,<br>
> highway text,<br>
> tracktype text,<br>
> label3 text,<br>
> belag numeric,<br>
> wegbreite numeric,<br>
> landnutz numeric,<br>
> length double precision,<br>
> the_geom geometry,<br>
> summe integer,<br>
> pid1 serial NOT NULL<br>
><br>
> Exporting the layer from postgis to shp and adding it to gvSIG
works<br>
> (so I obviously did not mess up the geometry type).<br>
> Any ideas /hints?<br>
><br>
> Best,<br>
><br>
> Johannes<br>
</div>
</div>
>
------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Gvsig_internacional mailing list<br>
> <a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
> <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
><br>
<br>
_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
</blockquote>
</div>
</div>
</div>
<br>
<br>
_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
</div>
</div>
-- <br>
Vladimir Perić<br>
General Manager<br>
BEOGIS d.o.o. Beograd<br>
Milutina Milankovića 130/109, Novi Beograd<br>
<br>
mob: +381642040889<br>
tel: +381112122810<br>
mail: <a href="mailto:vladimir.peric@beogis.com" target="_blank">vladimir.peric@beogis.com</a><br>
skype: vlada.peric<br>
site: <a href="http://www.beogis.com/" target="_blank">www.beogis.com</a><br>
<br>
_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br>
</blockquote>
</div>
</div>
</div>
<br>
</blockquote>
</div>
<br>
</div></div><pre><hr size="4" width="90%"><div class="im">
_______________________________________________
Gvsig_internacional mailing list
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a>
</div></pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br></blockquote></div><br>