<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Seliteteksti Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.Shkpostityyli17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.SelitetekstiChar
{mso-style-name:"Seliteteksti Char";
mso-style-priority:99;
mso-style-link:Seliteteksti;
font-family:"Tahoma","sans-serif";
mso-fareast-language:FI;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I correct myself, support for multiple geometry columns is not a bug but a missing feature. I just wrote about it into GDAL-dev list. Let’s see
what happens.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">When it comes to error with ‘limit 200000’ I believe that the real problem is in a different place. I bet that there is a faulty geometry somewhere
between 20000 and 200000 geometries. In that case OGR throws an error and stops. For Mapserver users it would be extremely much better if OGR in such case just skips the error and continues. I know the issue because it is common with OpenSteetMap polygons.
As a workaround I have myself just deleted all the non-valid geometries from Spatialite with “delete from table where ST_IsValid(geometry)=0”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Andrea Peri wrote:<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
>This looks like an OGR bug, I have correct info in views_geometry_columns (referin</span>g to
<br>
>geom2 of the main table) and in geometry_columns (both geom1 and geom2 has <br>
>records).<br>
><br>
>For now, forget multiple geometries and create new single geometry tables and enjoy the
<br>
>speed of Spatialite and Mapserver.<br>
><br>
>-Jukka Rahkonen-<br>
<br>
thx Jukka,<br>
<br>
Is an unpleasant situation this ogr bug.<br>
My table af many fields attribute . it is about 15 Gbyte (gasp!)<br>
so split it in two tables so separate the geometries is not a beatiful action. :)<br>
<br>
But I'm notice another question.<br>
<br>
Infact after remove the secondary geometries (sigh), I can see that there is a strange liit due to numer of elements.<br>
Infact Mapserver work with this sql:<br>
<br>
DATA 'SELECT field1, field2, field3, geometry from table LIMIT 20000'<br>
<br>
but don't work with this other sql:<br>
<br>
DATA 'SELECT field1, field2, field3, geometry from table LIMIT 200000'<br>
<br>
Seem there is a max number of elements retrieval.<br>
The strange is that with this second sql MapServer don't do nothing.<br>
Simply it end its work without generate no map.<br>
No error log report is write.<br>
<br>
Perhaps there is a setting to say how much memory mapserver (or ogr) must use for resultset from DB ?<br>
<br>
Thx.<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">2012/8/2 Rahkonen Jukka <<a href="mailto:Jukka.Rahkonen@mmmtike.fi" target="_blank">Jukka.Rahkonen@mmmtike.fi</a>><o:p></o:p></p>
<p class="MsoNormal">Hi again,<br>
<br>
Tried what ogrinfo sees in case of two geometries. It does not look good.<br>
<br>
FID Column = rowid<br>
Geometry Column = geom1<br>
geom2: Binary (0.0)<br>
OGRFeature(test2):1<br>
geom2 (Binary) = 0001110F0000958B843BA9EC354126C76C9BD95A5A41958B843BA9EC35412<br>
6C76C9BD95A...<br>
POINT (1436841.2324912299 6908774.4285142776)<br>
<br>
OGRFeature(test2):2<br>
geom2 (Binary) = 0001110F000081AE1AFBAEEF3541FB1B8FFA035B5A4181AE1AFBAEEF3541F<br>
B1B8FFA035B...<br>
POINT (1437614.9808758798 6908943.9149846984)<br>
<br>
So that means than only the first geometry can be user with OGR. Next I tried to create a spatial view with spatialite-gui by selecting only geom2 into the view. This fails too<br>
<br>
D:\ms4w\data>ogrinfo berlin.sqlite test3<br>
INFO: Open of `berlin.sqlite'<br>
using driver `SQLite' successful.<br>
ERROR 1: Underlying layer test2 for view test3 has not expected geometry column<br>
name (geom1 instead of geom2)<br>
<br>
Layer name: test3<br>
Geometry: Unknown (any)<br>
Feature Count: 0<br>
Layer SRS WKT:<br>
(unknown)<br>
FID Column = ROWID<br>
Geometry Column = geom2<br>
<br>
This looks like an OGR bug, I have correct info in views_geometry_columns (refering to geom2 of the main table) and in geometry_columns (both geom1 and geom2 has records).<br>
<br>
For now, forget multiple geometries and create new single geometry tables and enjoy the speed of Spatialite and Mapserver.<br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
________________________________________<br>
Lähettäjä: <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">
mapserver-users-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] käyttäjän Rahkonen Jukka [<a href="mailto:Jukka.Rahkonen@mmmtike.fi" target="_blank">Jukka.Rahkonen@mmmtike.fi</a>]
puolesta<br>
Lähetetty: 3. elokuuta 2012 0:27<br>
Vastaanottaja: Andrea Peri; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">
mapserver-users@lists.osgeo.org</a><br>
Aihe: Re: [mapserver-users] Using spatialite with mapserver<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Hi,<br>
<br>
The SELECT alternative works fine for me but I do not have multiple geometries. I made a very fast test on Spatialite side and it seems to be possible to run "Recover geometry column" and "Create spatial index" for multiple geometries but I did not test the
result with Mapserver.<br>
<br>
I would recommend you to check first your geometry_columns table and see it there is a line for the geometry you want to use and if spatial index is OK. If they are OK make a simplified test. Create a single geometry table as<br>
CREATE table test as<br>
SELECT geom1, attr1... FROM...<br>
Do "Recover geometry column" and "Create spatial index" things for the new table and have a try with Mapserver.<br>
<br>
GDAL version must be 1.9 or higher or things will be far too slow.<br>
This document may also be useful for you<br>
<a href="http://latuviitta.org/documents/Super_easy_WMS_server.pdf" target="_blank">http://latuviitta.org/documents/Super_easy_WMS_server.pdf</a><br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
<br>
<br>
<br>
________________________________<br>
Lähettäjä: <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">
mapserver-users-bounces@lists.osgeo.org</a> [<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] käyttäjän Andrea Peri [<a href="mailto:aperi2007@gmail.com" target="_blank">aperi2007@gmail.com</a>]
puolesta<br>
Lähetetty: 2. elokuuta 2012 23:03<br>
Vastaanottaja: <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
Aihe: [mapserver-users] Using spatialite with mapserver<br>
<br>
Hi,<br>
I'm try-ing to use spatialite with mapserver.<br>
<br>
is this mapfile configuration ok for spatialite ?<br>
<br>
CONNECTIONTYPE OGR<br>
CONNECTION '/..path-to../spatialite_file.sqlite'<br>
DATA 'SELECT field1, field2, field3, geometry from table'<br>
<br>
It seem don't work.<br>
<br>
Instead work perfectly this other configuration:<br>
<br>
CONNECTIONTYPE OGR<br>
CONNECTION '/home/vector/vettoriali/db_catasto/regione_toscana/adt_toscana.sqlite'<br>
DATA 'table'<br>
<br>
Unfortunately this second configuration don't allow to choose the geometry field , necessary when spatialite table as two or more geometry field.<br>
<br>
Thx,<br>
<br>
--<br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . .<br>
qwerty àèìòù<br>
-----------------<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br clear="all">
<br>
-- <br>
-----------------<br>
Andrea Peri<br>
. . . . . . . . . <br>
qwerty àèìòù<br>
-----------------<o:p></o:p></p>
</div>
</div>
</body>
</html>