Re: [mapserver-users] Getting introduced to MapScript

2012-08-03 Thread Luís de Sousa
Thank you Stephen, loading an existing MapFile and looking into its contents
should help indeed, but it is a bit frustrating to see such basic things
lacking in the documentation.

In any case, I'd ask again if this is the right place to ask help for on
MapScript, or if there's another forum dedicated to it.

Thank you,

Luís



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Getting-introduced-to-MapScript-tp4992463p4992863.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Getting introduced to MapScript

2012-08-03 Thread Luís de Sousa
Hi Cristiano, thank you for the reply.

I'm precisely trying to build a wrapper API for the specific where you a GML
file and want to automatically publish it through MapServer.

If I understand correctly from your message there is no way set the layer
TYPE attribute directly. Is this the same with the DATA attribute? In such
case how can it be set?

Thank you,

Luís


On 2 August 2012 14:37, Cristiano Sumariva sumar...@gmail.com wrote:
 Well if you have time to do it, I strong suggest you to create a thin
 wrapper about mapscript. This is for case you can have a safe, programmer
 friendly API.
 Or at least create a Factory class for some mapscript constructs. This
 will
 save you of much trouble in future when you going need change something.

 For your commented object layerObj the mapscript function or method to
 creating a new layer would be new layer( parent ).
 What would lead you to map draw failure because layerobj type was not set.

 So use a factory like LayerFactory.createPolygon( mapobj ) that will set
 things properly.

 I guess the minimum mapfile stuff required are:
 - map size output
 - map ground coordinates position
 - one layer obj( a lot of attributes set here )
 -- one class at layerobj( a few atrtibutes set here )
 --- one style at above class( presentation, color stuff here )

 optional
 if going work with different projections
 - the map projetion attribute
 - for each layer the projection attribute.

 Again would be very nice to have a wrapper that raise error you if have a
 layer without projection attribute in presence of it at map object.



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Getting-introduced-to-MapScript-tp4992463p4992866.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Using spatialite with mapserver

2012-08-03 Thread Andrea Peri
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).

For now, forget multiple geometries and create new single geometry tables
and enjoy the
speed of Spatialite and Mapserver.

-Jukka Rahkonen-

thx Jukka,

Is an unpleasant situation this ogr bug.
My table af many fields attribute . it is about 15 Gbyte (gasp!)
so split it in two tables so separate the geometries is not a beatiful
action. :)

But I'm notice another question.

Infact after remove the secondary geometries (sigh), I can see that there
is a strange liit due to numer of elements.
Infact Mapserver work with this sql:

DATA 'SELECT field1, field2, field3, geometry from table LIMIT 2'

but don't work with this other sql:

DATA 'SELECT field1, field2, field3, geometry from table LIMIT 20'

Seem there is a max number of elements retrieval.
The strange is that with this second sql MapServer don't do nothing.
Simply it end its work without generate no map.
No error log report is write.

Perhaps there is a setting to say how much memory mapserver (or ogr) must
use for resultset from DB ?

Thx.


2012/8/2 Rahkonen Jukka jukka.rahko...@mmmtike.fi

 Hi again,

 Tried what ogrinfo sees in case of two geometries. It does not look good.

 FID Column = rowid
 Geometry Column = geom1
 geom2: Binary (0.0)
 OGRFeature(test2):1
   geom2 (Binary) =
 0001110F958B843BA9EC354126C76C9BD95A5A41958B843BA9EC35412
 6C76C9BD95A...
   POINT (1436841.2324912299 6908774.4285142776)

 OGRFeature(test2):2
   geom2 (Binary) =
 0001110F81AE1AFBAEEF3541FB1B8FFA035B5A4181AE1AFBAEEF3541F
 B1B8FFA035B...
   POINT (1437614.9808758798 6908943.9149846984)

 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

 D:\ms4w\dataogrinfo berlin.sqlite test3
 INFO: Open of `berlin.sqlite'
   using driver `SQLite' successful.
 ERROR 1: Underlying layer test2 for view test3 has not expected geometry
 column
 name (geom1 instead of geom2)

 Layer name: test3
 Geometry: Unknown (any)
 Feature Count: 0
 Layer SRS WKT:
 (unknown)
 FID Column = ROWID
 Geometry Column = geom2

 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).

 For now, forget multiple geometries and create new single geometry tables
 and enjoy the speed of Spatialite and Mapserver.

 -Jukka Rahkonen-


 
 Lähettäjä: mapserver-users-boun...@lists.osgeo.org [
 mapserver-users-boun...@lists.osgeo.org] k#228;ytt#228;j#228;n
 Rahkonen Jukka [jukka.rahko...@mmmtike.fi] puolesta
 Lähetetty: 3. elokuuta 2012 0:27
 Vastaanottaja: Andrea Peri; mapserver-users@lists.osgeo.org
 Aihe: Re: [mapserver-users] Using spatialite with mapserver

 Hi,

 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.

 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
 CREATE table test as
 SELECT geom1, attr1... FROM...
 Do Recover geometry column and Create spatial index things for the new
 table and have a try with Mapserver.

 GDAL version must be 1.9 or higher or things will be far too slow.
 This document may also be useful for you
 http://latuviitta.org/documents/Super_easy_WMS_server.pdf

 -Jukka Rahkonen-





 
 Lähettäjä: mapserver-users-boun...@lists.osgeo.org [
 mapserver-users-boun...@lists.osgeo.org] käyttäjän Andrea Peri [
 aperi2...@gmail.com] puolesta
 Lähetetty: 2. elokuuta 2012 23:03
 Vastaanottaja: mapserver-users@lists.osgeo.org
 Aihe: [mapserver-users] Using spatialite with mapserver

 Hi,
 I'm try-ing to use spatialite with mapserver.

 is this mapfile configuration ok for spatialite ?

 CONNECTIONTYPE OGR
 CONNECTION '/..path-to../spatialite_file.sqlite'
 DATA 'SELECT field1, field2, field3, geometry from table'

 It seem don't work.

 Instead work perfectly this other configuration:

 CONNECTIONTYPE OGR
 CONNECTION
 '/home/vector/vettoriali/db_catasto/regione_toscana/adt_toscana.sqlite'
 DATA 'table'

 Unfortunately this second configuration don't allow to choose the geometry
 field , necessary when spatialite table as two or more geometry field.

 Thx,

 --
 -
 Andrea Peri
 . . . . . . . . .
 qwerty àèìòù
 -

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 

Re: [mapserver-users] Using spatialite with mapserver

2012-08-03 Thread Rahkonen Jukka
Hi,

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.

When it comes to error with 'limit 20' I believe that the real problem is 
in a different place.  I bet that there is a faulty geometry somewhere between 
2 and 20 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.

-Jukka Rahkonen-






Andrea Peri wrote:


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).

For now, forget multiple geometries and create new single geometry tables and 
enjoy the
speed of Spatialite and Mapserver.

-Jukka Rahkonen-

thx Jukka,

Is an unpleasant situation this ogr bug.
My table af many fields attribute . it is about 15 Gbyte (gasp!)
so split it in two tables so separate the geometries is not a beatiful action. 
:)

But I'm notice another question.

Infact after remove the secondary geometries (sigh), I can see that there is a 
strange liit due to numer of elements.
Infact Mapserver work with this sql:

DATA 'SELECT field1, field2, field3, geometry from table LIMIT 2'

but don't work with this other sql:

DATA 'SELECT field1, field2, field3, geometry from table LIMIT 20'

Seem there is a max number of elements retrieval.
The strange is that with this second sql MapServer don't do nothing.
Simply it end its work without generate no map.
No error log report is write.

Perhaps there is a setting to say how much memory mapserver (or ogr) must use 
for resultset from DB ?

Thx.

2012/8/2 Rahkonen Jukka 
jukka.rahko...@mmmtike.fimailto:jukka.rahko...@mmmtike.fi
Hi again,

Tried what ogrinfo sees in case of two geometries. It does not look good.

FID Column = rowid
Geometry Column = geom1
geom2: Binary (0.0)
OGRFeature(test2):1
  geom2 (Binary) = 0001110F958B843BA9EC354126C76C9BD95A5A41958B843BA9EC35412
6C76C9BD95A...
  POINT (1436841.2324912299 6908774.4285142776)

OGRFeature(test2):2
  geom2 (Binary) = 0001110F81AE1AFBAEEF3541FB1B8FFA035B5A4181AE1AFBAEEF3541F
B1B8FFA035B...
  POINT (1437614.9808758798 6908943.9149846984)

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

D:\ms4w\dataogrinfo berlin.sqlite test3
INFO: Open of `berlin.sqlite'
  using driver `SQLite' successful.
ERROR 1: Underlying layer test2 for view test3 has not expected geometry column
name (geom1 instead of geom2)

Layer name: test3
Geometry: Unknown (any)
Feature Count: 0
Layer SRS WKT:
(unknown)
FID Column = ROWID
Geometry Column = geom2

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).

For now, forget multiple geometries and create new single geometry tables and 
enjoy the speed of Spatialite and Mapserver.

-Jukka Rahkonen-



Lähettäjä: 
mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org
 
[mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org]
 k#228;ytt#228;j#228;n Rahkonen Jukka 
[jukka.rahko...@mmmtike.fimailto:jukka.rahko...@mmmtike.fi] puolesta
Lähetetty: 3. elokuuta 2012 0:27
Vastaanottaja: Andrea Peri; 
mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org
Aihe: Re: [mapserver-users] Using spatialite with mapserver

Hi,

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.

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
CREATE table test as
SELECT geom1, attr1... FROM...
Do Recover geometry column and Create spatial index things for the new 
table and have a try with Mapserver.

GDAL version must be 1.9 or higher or things will be far too slow.
This document may also be useful for you
http://latuviitta.org/documents/Super_easy_WMS_server.pdf

-Jukka Rahkonen-






Lähettäjä: 
mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org
 
[mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org]
 

[mapserver-users] Bug in Oracle-Spatial-Support

2012-08-03 Thread umn-ms

Hi

We are using Mapserver 6.0.3
We think there is a serious problem in the TRY-Method of maporaclespatial.c

SHORT DIAGNOSIS:
I think there is a serious problem in the TRY-Method of maporaclespatial.c.
After the first error in the msOracleSpatialHandler this method will always
return  0, which indicates an error.
Therefore mapserver won't work with this msOracleSpatialHandler after the
first OCI-error occured with it.

COMPLEX DIAGNOSIS:
A testcase where this becomes a problem is
1. Mapfile with 2 layers from the same Oracle-Spatial-Database
2. Java-Binding with
mapObj map = new mapObj(small.map);
layerObj gemLayer = map.getLayerByName(Gemeinden);
gemLayer.queryByAttributes(map, null, Gemeinde_id=2, mapscript
.MS_SINGLE);
imageObj img = map.drawQuery();

  The layer Gemeinde must be the second layer.

This will fail with the message:
[Fri Aug 03 10:35:58 2012].64000 msOracleSpatialLayerGetShape():
OracleSpatial error. Shape type is null... this probably means a record
number was requested that could not have beeen in a result set (as returned
by NextShape).
This message occurs while drawing the query-layer (of Gemeinden).

This message indicates,  that there is an error on converting a
Spatial-Geometry to a Mapserver-Geometry in osGetOrdinates.
Inside  osGetOrdinates there is an OCI-call surrounded with TRY  and this
TRY returns 0/error.

In reality the OCI-error already occured while drawing another layer, which
used the same msOracleSpatialHandler.
And *every* layer will cause at least one OCI-Error in
msOracleSpatialLayerNextShape when reaching the end of the Cursor!

THERAPY:
We are not quite shure what to do.
Option 1:
   In TRY remove the if (hand-last_oci_status == MS_FAILURE) ...
statement.
   Since sequences of OCI-Calls are usually made with TRY()  TRY() ...
   this statement seems superflous.

Option 2:
   Reset hand-last_oci_status to MS_SUCCESS often.
   Example: Reset it in  msOracleSpatialLayerNextShape
   Example: Rest at the beginning of osGetOrdinates
   Any of these patches will   solve the problem of the testcase.

I'm note shure, how to fix this general problem best.

Could somebody take care? This one is a serious obstacle on using
mapserver.
We looked at Mapserver 6.2-Code. The problematic lines of codes seem to be
unchanged.

Bye
Benedikt

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] getShape failing; changes from mapserver 5.6 to 6.0

2012-08-03 Thread Stefan Schwarzer
Hi there,

I am struggling with a few changes I need to go through in order to make my 
code working now with mapserver 6.x. This one concerns the query part, when a 
user clicks on the map and a window with some metadata is being displayed.

An error message occurred:

Catchable fatal error: Argument 1 passed to layerObj::getShape() must 
be an instance of resultObj, integer given

When I changed the getShape command as indicated here [1], it says:

Fatal error: Call to a member function getShape() on a non-object


This is the code:

//Query the Map at the point clicked
if (!$imgbox)
@$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);

if ($a == MS_SUCCESS)
{

$numResults = $Layer - getNumResults();
$oLayer = $map - getLayer($Layer - index);

// Open layer's table... take the list of fields to display 
from 
// the HEADERRESULT_FIELDS metadata in the layer object.
$oLayer - open();

$oRes = $oLayer - getResult(0);
//$oShape = $oLayer - 
getShape($oRes-tileindex,$oRes-shapeindex);// before
$oShape = $layer - getShape($oLayer - getResult(0));  
// now ??


while(list($key, $val) = each($oShape - values))
{
//echo br /x - .count($selFields). - .$key .  =  . 
$val;
if (($key  META_DATA) AND ($key  oid) AND ($key 
 id) AND ($key  uid))
$selFields[count($selFields)] = $key;
}



Not sure what I should put there…

Thanks for any hints,

Stefan


[1] http://mapserver.org/MIGRATION_GUIDE.html
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Getting introduced to MapScript

2012-08-03 Thread Stephen Woodbridge

On 8/3/2012 3:49 AM, Luís de Sousa wrote:

Thank you Stephen, loading an existing MapFile and looking into its contents
should help indeed, but it is a bit frustrating to see such basic things
lacking in the documentation.

In any case, I'd ask again if this is the right place to ask help for on
MapScript, or if there's another forum dedicated to it.


Yes, there are a lot of mapscript developers here and I'm sure we will 
be happy to answer questions.


FYI, since you are using Python mapscript you want to look at the SWIG 
mapscript API. There are small differences between SWIG and PHP flavors 
of mapscript so just be forewarned.


-Steve W

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] getShape failing; changes from mapserver 5.6 to 6.0

2012-08-03 Thread Lime, Steve D (DNR)
The query code underwent major changes between 5.6 and 6.0 and one casualty was 
query processing like you're doing. On the bright side it's much more straight 
forward now. The general steps for a layer-based query is now just:

$layer-queryByRect($map, $rect); # layer is left open after a query operation

for($i=0; $i$layer-getNumResults(); $i++) {
   $shape = $layer-getShape($layer-getResult($)); # much simpler
   # do something with the shape
}

I see the MapScript/Swig query docs are woefully out of date. I'll file a 
ticket on that...

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Stefan Schwarzer
Sent: Friday, August 03, 2012 6:37 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] getShape failing; changes from mapserver 5.6 to 6.0

Hi there,

I am struggling with a few changes I need to go through in order to make my 
code working now with mapserver 6.x. This one concerns the query part, when a 
user clicks on the map and a window with some metadata is being displayed.

An error message occurred:

Catchable fatal error: Argument 1 passed to layerObj::getShape() must 
be an instance of resultObj, integer given

When I changed the getShape command as indicated here [1], it says:

Fatal error: Call to a member function getShape() on a non-object


This is the code:

//Query the Map at the point clicked
if (!$imgbox)
@$a = $map - queryByPoint($click_pt, MS_MULTIPLE, -1);
else
$a = $map - queryByRect($click_rt);

if ($a == MS_SUCCESS)
{

$numResults = $Layer - getNumResults();
$oLayer = $map - getLayer($Layer - index);

// Open layer's table... take the list of fields to display 
from 
// the HEADERRESULT_FIELDS metadata in the layer object.
$oLayer - open();

$oRes = $oLayer - getResult(0);
//$oShape = $oLayer - 
getShape($oRes-tileindex,$oRes-shapeindex);// before
$oShape = $layer - getShape($oLayer - getResult(0));  
// now ??


while(list($key, $val) = each($oShape - values))
{
//echo br /x - .count($selFields). - .$key .  =  . 
$val;
if (($key  META_DATA) AND ($key  oid) AND ($key 
 id) AND ($key  uid))
$selFields[count($selFields)] = $key;
}



Not sure what I should put there...

Thanks for any hints,

Stefan


[1] http://mapserver.org/MIGRATION_GUIDE.html
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] MapServer and ArcSDE

2012-08-03 Thread Simon McCabe
Hi All,

I have an ArcSDE 10 database in SQL server.

Can you let me know the best approach to viewing this data in MapServer - for 
example, should I compile SDE support into MapServer or alternatively use the 
OGR approach to viewing it?

Any hints would be much appreciated - I don't have a lot of experience with 
ArcSDE but have a lot with MapServer.

Regards
Simon

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver Template - Conditionals

2012-08-03 Thread Lime, Steve D (DNR)
Hi Donald: To answer your questions...

1. You can't do an AND with [item ...] tags. They are single item only. We'd 
really need to introduce true conditionals into the templates. It's done a bit 
for legend templates but I don't know how much work is necessary to extend 
that. One work around idea would be to create a compound item if using a RDMS 
data source and write patterns against that.

2. Consider filing ticket for that one. Covers item 4 too.

3. I actually had something along those lines in mind at one point. I'll have 
to check my old notes. Note that if the patterns are mutually exclusive you can 
just write:

[item name=A pattern=1 format=Output1][item name=B pattern=2 
format=Output2][item name=C pattern=3 format=Output3 
nullformat=Output4]

The default format would just be the null format for one of these. But I agree 
this has it's limits...

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Donald Kerr
Sent: Wednesday, July 25, 2012 2:25 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapserver Template - Conditionals

Hi List,

A few questions/points on templating:

1.
I know it's possible to use item in a template as follows:

[item name=featurecode pattern=10021
format=osgb:themeBuildings/osgb:themeosgb:descriptiveGroupBuilding/o
sgb:descriptiveGroup escape=none]

But, is it possible to do something like:

[item featurecode=10021 pattern=1 AND item lineitem=12345 pattern=2
format=.]

That is, returns true of both, or more, criteria are met.

The only other way I can think of doing this is in the SQL query that runs on 
the layer.


2.
Also, when I use use [item ...] and the criteria isn't met, it still causes an 
additional blank line to be created in the output file. It would be quite good 
if it did not create the cr/lf. Maybe nullformat could be used to enforce this 
in some way but nullformat= still creates a blank line.


3.
It would be nice if the item tag could also deal with a case/select statement 
e.g.

[item name=A pattern=1 format=Output1] ELSE [item name=B pattern=2 
format=Output2] ELSE [item name=C pattern=3 format=Output3] DEFAULT 
[item name=D pattern=4 format=Output4]


4.
And finally, when using:

[resultset layer=LayerName]
[feature]

Two blank lines are created in the output file. It would be good if these tags 
didn't do that.


Many thanks.

Regards,

Donald

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Basic Templating

2012-08-03 Thread Lime, Steve D (DNR)
If you're using templates to present query results the template should be 
referenced in a layer. TEMPLATE in the web object is for mode=browse only and 
is generally not used much anymore.

What does your query URL look like? The template you pasted below doesn't look 
to contain any references to layer attributes. It looks like just a stock 
browse template.

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sowmya Tiramdasu
Sent: Thursday, August 02, 2012 4:04 PM
To: 'Mapserver-users'
Subject: [mapserver-users] Basic Templating

Hi ,

  I am trying to implement templating taking the help of the mapserver 
tutorial. I created my own map file, which works fine. I get the output as 
desired when I use mode=map. Now I am trying to include a template for my 
example. I created a new template file 'gmapNew.html' . I added the reference 
to this template file in my map file. Yet When I am submitting a query, the 
template values are not being substituted correctly and so not getting my 
required result.
--
The snippet of my map file where I am referencing my template file.

MAP
IMAGETYPE  PNG
EXTENT-9423052.40 4582638.15  -9414491.41 
4589289.39 # extents of las file for 3875 using cs2cs
#EXTENT1525556.83 190608.70 1547770.63 207656.82 #las 
files
#EXTENT -9435462.86 4562596.42  -9387971.96 
4608897.38 # sbet lat lon to extent using cs2cs
SIZE   1020 980
SHAPEPATH  ../data
SYMBOLSET  ../symbols/symbols35.sym
#TRANSPARENT ON
IMAGECOLOR 0 0 0
FONTSET../fonts/fonts.list
PROJECTION
#init=epsg:2246
init=epsg:3857
END

WEB
TEMPLATE  gmapNew.html
IMAGEPATH /ms4w/tmp/ms_tmp/
IMAGEURL /ms_tmp/
METADATA
wms_enable_request *
wms_title WMS Lidar Server
wms_onlineresource 
http://localhost:8080/keenland?;
wms_srs espg:32617
END
 END

.
.
END

-
My template file.

!-- MapServer Template --
!DOCTYPE html
  PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=content-type content=text/html; charset=utf-8/
titleGoogle/MapServer Tile Example/title
link type=text/css rel=stylesheet href=[root]/ms35.css /
/head
body 
!-- The central form the application is based on. --
form name=mapserv method=GET action=[program]
input type=hidden name=root value=[root] /
input type=hidden name=program 
value=[program] /
input type=hidden name=map_web 
value=[map_web] /
input type=hidden name=map value=[map] /
input type=hidden name=imgext 
value=[mapext] /
input type=hidden name=imgxy 
value=[center] /
input type=hidden name=layers 
value=[layers] /
input type=hidden name=zoom value=[zoom] 
/
table border=0 cellpadding=5
tr
!-- First 
column: Map and scale bar --
td 
align=center

!-- The map --

input type=image name=img src=[img] 
style=border:0;width:300;height:400

br

/td
td

div align=center

input type=submit name=submit value=Refresh

/div
   

[mapserver-users] Image quality

2012-08-03 Thread Travis Kirstine
I am having issues with the output image quality of MapServer.  I have
a mapserver set up as a wms server up high res orthophoto images.  The
images are in tiled geotiff format with JPEG / YCBCR compression with
internal gaussen overviews and referenced using a tile index in the
mapfile with the PROCESSING RESAMPLE=BILINEAR directive.  Mapserver
5.6.7 is set up using AGG with imagemode RGBA.  I have noticed that
the images generated have aliasing in areas of high contrast when
viewing at various scales (full res seems fine).  What is the optimal
setup to reduce this effect?

Regards
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapserver Template - Conditionals

2012-08-03 Thread Donald Kerr
Steve,

Thanks for your input again.

I've filed a ticket for 2 and 4 as I think that would tidy things up a good
deal. Although blank lines don't really cause any problem, it's a bit untidy
and, if there are a load of item declarations, there can be a lot of blank
lines. See ticket here: https://github.com/mapserver/mapserver/issues/4415

As for 1 and 3, I can get around that with case statements in Postgres SQL
but I was trying to do it all in either SQL or the template rather than a
bit of both.

Thanks again.

Regards.

Donald



-Original Message-
From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] 
Sent: 03 August 2012 18:22
To: Donald Kerr; mapserver-users@lists.osgeo.org
Subject: RE: [mapserver-users] Mapserver Template - Conditionals


Hi Donald: To answer your questions...

1. You can't do an AND with [item ...] tags. They are single item only. We'd
really need to introduce true conditionals into the templates. It's done a
bit for legend templates but I don't know how much work is necessary to
extend that. One work around idea would be to create a compound item if
using a RDMS data source and write patterns against that.

2. Consider filing ticket for that one. Covers item 4 too.

3. I actually had something along those lines in mind at one point. I'll
have to check my old notes. Note that if the patterns are mutually exclusive
you can just write:

[item name=A pattern=1 format=Output1][item name=B pattern=2
format=Output2][item name=C pattern=3 format=Output3
nullformat=Output4]

The default format would just be the null format for one of these. But I
agree this has it's limits...

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Donald Kerr
Sent: Wednesday, July 25, 2012 2:25 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapserver Template - Conditionals

Hi List,

A few questions/points on templating:

1.
I know it's possible to use item in a template as follows:

[item name=featurecode pattern=10021
format=osgb:themeBuildings/osgb:themeosgb:descriptiveGroupBuilding/o
sgb:descriptiveGroup escape=none]

But, is it possible to do something like:

[item featurecode=10021 pattern=1 AND item lineitem=12345 pattern=2
format=.]

That is, returns true of both, or more, criteria are met.

The only other way I can think of doing this is in the SQL query that runs
on the layer.


2.
Also, when I use use [item ...] and the criteria isn't met, it still causes
an additional blank line to be created in the output file. It would be quite
good if it did not create the cr/lf. Maybe nullformat could be used to
enforce this in some way but nullformat= still creates a blank line.


3.
It would be nice if the item tag could also deal with a case/select
statement e.g.

[item name=A pattern=1 format=Output1] ELSE [item name=B pattern=2
format=Output2] ELSE [item name=C pattern=3 format=Output3] DEFAULT
[item name=D pattern=4 format=Output4]


4.
And finally, when using:

[resultset layer=LayerName]
[feature]

Two blank lines are created in the output file. It would be good if these
tags didn't do that.


Many thanks.

Regards,

Donald

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] [gdal-dev] Spatialite tables with multiple geometry columns

2012-08-03 Thread Even Rouault
Andrea created http://trac.osgeo.org/gdal/ticket/4768 and I've just committed 
the code in trunk to add that support. I've tested it with a tiny sample just 
made for the unit test. No reason it should not work with more complex DBs, 
but testing appreciated.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Using spatialite with mapserver

2012-08-03 Thread Andrea Peri
Hi

the 200.000 limit was effectively an invalid geometries,

thx.

About the multi-geometry question.

I'm try-ing the option

DATA 'table(geometry)'

but I have a secondary problem.
Infact this sintax seem deny the access to other fields.
So was impossible to set a label.

I'm missing something ?

Thx,

Andrea

2012/8/3 Rahkonen Jukka jukka.rahko...@mmmtike.fi

  Hi,

 ** **

 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.

 ** **

 When it comes to error with ‘limit 20’ I believe that the real problem
 is in a different place.  I bet that there is a faulty geometry somewhere
 between 2 and 20 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”.

 ** **

 -Jukka Rahkonen-

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 Andrea Peri wrote:

 ** **


 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).
 
 For now, forget multiple geometries and create new single geometry tables
 and enjoy the
 speed of Spatialite and Mapserver.
 
 -Jukka Rahkonen-

 thx Jukka,

 Is an unpleasant situation this ogr bug.
 My table af many fields attribute . it is about 15 Gbyte (gasp!)
 so split it in two tables so separate the geometries is not a beatiful
 action. :)

 But I'm notice another question.

 Infact after remove the secondary geometries (sigh), I can see that there
 is a strange liit due to numer of elements.
 Infact Mapserver work with this sql:

 DATA 'SELECT field1, field2, field3, geometry from table LIMIT 2'

 but don't work with this other sql:

 DATA 'SELECT field1, field2, field3, geometry from table LIMIT 20'

 Seem there is a max number of elements retrieval.
 The strange is that with this second sql MapServer don't do nothing.
 Simply it end its work without generate no map.
 No error log report is write.

 Perhaps there is a setting to say how much memory mapserver (or ogr) must
 use for resultset from DB ?

 Thx.

 

 2012/8/2 Rahkonen Jukka jukka.rahko...@mmmtike.fi

 Hi again,

 Tried what ogrinfo sees in case of two geometries. It does not look good.

 FID Column = rowid
 Geometry Column = geom1
 geom2: Binary (0.0)
 OGRFeature(test2):1
   geom2 (Binary) =
 0001110F958B843BA9EC354126C76C9BD95A5A41958B843BA9EC35412
 6C76C9BD95A...
   POINT (1436841.2324912299 6908774.4285142776)

 OGRFeature(test2):2
   geom2 (Binary) =
 0001110F81AE1AFBAEEF3541FB1B8FFA035B5A4181AE1AFBAEEF3541F
 B1B8FFA035B...
   POINT (1437614.9808758798 6908943.9149846984)

 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

 D:\ms4w\dataogrinfo berlin.sqlite test3
 INFO: Open of `berlin.sqlite'
   using driver `SQLite' successful.
 ERROR 1: Underlying layer test2 for view test3 has not expected geometry
 column
 name (geom1 instead of geom2)

 Layer name: test3
 Geometry: Unknown (any)
 Feature Count: 0
 Layer SRS WKT:
 (unknown)
 FID Column = ROWID
 Geometry Column = geom2

 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).

 For now, forget multiple geometries and create new single geometry tables
 and enjoy the speed of Spatialite and Mapserver.

 -Jukka Rahkonen-


 
 Lähettäjä: mapserver-users-boun...@lists.osgeo.org [
 mapserver-users-boun...@lists.osgeo.org] k#228;ytt#228;j#228;n
 Rahkonen Jukka [jukka.rahko...@mmmtike.fi] puolesta
 Lähetetty: 3. elokuuta 2012 0:27
 Vastaanottaja: Andrea Peri; mapserver-users@lists.osgeo.org
 Aihe: Re: [mapserver-users] Using spatialite with mapserver


 Hi,

 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.

 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
 CREATE table test as
 SELECT geom1, attr1... FROM...
 Do Recover geometry column and Create spatial index things for the new
 table and have a try with Mapserver.

 GDAL version must be 1.9 or higher or things will be