[mapserver-users] 16 bit (rgb 565) output format

2012-05-15 Thread Ian Walberg
Is it possible to output in old fashioned true colour 16 bit rgb 565
format?

I have been looking through the output format settings and cannot see
anything.

If not does anyone know of a util to convert from 24 bit to 16 bit.

Thanks

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


RE: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Alberto Najera
Well, we spend a few hours debugging a 900 plus lines mapfile. We missed a
few ends, had a few extra of them plus some other errors like typos in the
source file calls. So a tool like this would be extremely useful.

I use UltraEdit version 14.00a and have was not aware of such a template.
How can it be activated?



Alberto Najera
 

De: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] En nombre de Bob Basques
Enviado el: martes, 15 de mayo de 2012 11:14 a.m.
Para: ivan.min...@gmail.com; mapserver-users; Steve D (DNR) Lime
Asunto: RE: [mapserver-users] Mapfile verification tool

All, 

I've approached this topic over the years by having a nice Syntax editor
available for MapFiles.  Both VI and UltraEdit have proven to have good
syntax templates for highlighting of edited  MAPFILEs. 

I know this is exactly what was being asked about.  But upon further
thought, I wonder if a VI script couldn't be put together to do some of this
checking, at least in pairing of quotes and END statements. 

Just a thought. 

bobb 


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


Re: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Josh Hevenor
What's the state of the XML mapfile?   Could one create their mapfile in
an XML editor to generate a syntactically valid mapfile (through xslt)
then use shp2img to verify data connections?

On 5/15/2012 11:57 AM, Lime, Steve D (DNR) wrote:
> Shp2img already provides this capability and is more portable than MapScript. 
> I think ideally we'd develop 
> a validator that spits out all errors but that's probably not possible either 
> since many common error states 
> (like a missing END or quote) will trigger a whole bunch of false positives. 
> Best to take it an error at a 
> time for most cases. This might be useful more for between version migration 
> where the mapfile is structurally
> sound but keywords have changed.
>
> We could write a dumber version of shp2img that only tries to load the 
> mapfile and report an error but I'm not
> sure it's worth the effort.
>
> Steve
>
> -Original Message-
> From: mapserver-users-boun...@lists.osgeo.org 
> [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ivan Mincik
> Sent: Tuesday, May 15, 2012 10:24 AM
> To: mapserver-users
> Subject: Re: [mapserver-users] Mapfile verification tool
>
>> I don't think this will work because the mapfile is read all at once 
>> and parsed into an internal data structure. You can't access it in 
>> mapscript until the parser has read it and the parser will error out on any 
>> errors.
> Understand, but i mean only valid/invalid output from test script. If some 
> error will raised - mapfile is invalid, with no other information where 
> otherwise mapfile is OK.
>
>
> --
> Ivan Mincik
> ___
> 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
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.455 / Virus Database: 271.1.1/4999 - Release Date: 05/14/12 
> 18:05:00
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Some Doubts in WMS Time Documentation

2012-05-15 Thread Paolo Corti
On Tue, May 15, 2012 at 3:41 PM, abhishek bansal  wrote:
> Thank You very much for your reply.. I have read that document for like
> thousand times but could never understand that. I am still confused because
> the layer "time_idx" is polygon type(which is vector type) layer, So how I
> will be able to render raster based upon time.
> I have my rasters (with tiling) stored in PostGIS 2.0 database.
>

I think that the document you are referring is very clear, in any case
I try to give you quick general instructions to put you on the way.
.
Your scenario
---

* you have one raster for each different time
* you want to create a WMS that can parse the TIME parameter for
displaying the correct raster/rasters for that time

What you need to do
--

* you need to have a tile index: this is a polygon vector dataset, it
could be for example a shapefile or a PostGIS table
* if you are using a shapefile (I suggest you to keep it simple and
start with a shapefile), the gdaltindex utility [1] is very handy
* the shapefile must contain one polygon with each raster dataset
extent. You also need a text field (filepath in the example), with the
physical path of that raster and a date field (datetime in the
example), with the date of that raster
* if you created the shapefile with gdaltindex, you will need to add
yourself the values for the datetime field (most likely with an OGR
script)

If you follow this instruction it should work for you
p

[1] http://www.gdal.org/gdaltindex.html

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Bob Basques

Oops, sorry about the typo below, I meant to say "I know this isn't exactly . . 
." 

bobb 



>>> "Bob Basques"  wrote:


All, 


I've approached this topic over the years by having a nice Syntax editor 
available for MapFiles.  Both VI and UltraEdit have proven to have good syntax 
templates for highlighting of edited  MAPFILEs. 


I know this is exactly what was being asked about.  But upon further thought, I 
wonder if a VI script couldn't be put together to do some of this checking, at 
least in pairing of quotes and END statements. 


Just a thought. 


bobb 




>>> "Lime, Steve D (DNR)"  wrote:


Shp2img already provides this capability and is more portable than MapScript. I 
think ideally we'd develop
a validator that spits out all errors but that's probably not possible either 
since many common error states
(like a missing END or quote) will trigger a whole bunch of false positives. 
Best to take it an error at a
time for most cases. This might be useful more for between version migration 
where the mapfile is structurally
sound but keywords have changed.

We could write a dumber version of shp2img that only tries to load the mapfile 
and report an error but I'm not
sure it's worth the effort.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ivan Mincik
Sent: Tuesday, May 15, 2012 10:24 AM
To: mapserver-users
Subject: Re: [mapserver-users] Mapfile verification tool

> I don't think this will work because the mapfile is read all at once
> and parsed into an internal data structure. You can't access it in
> mapscript until the parser has read it and the parser will error out on any 
> errors.

Understand, but i mean only valid/invalid output from test script. If some 
error will raised - mapfile is invalid, with no other information where 
otherwise mapfile is OK.


--
Ivan Mincik
___
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 mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Bob Basques

All, 

I've approached this topic over the years by having a nice Syntax editor 
available for MapFiles.  Both VI and UltraEdit have proven to have good syntax 
templates for highlighting of edited  MAPFILEs. 

I know this is exactly what was being asked about.  But upon further thought, I 
wonder if a VI script couldn't be put together to do some of this checking, at 
least in pairing of quotes and END statements. 

Just a thought. 

bobb 



>>> "Lime, Steve D (DNR)"  wrote:


Shp2img already provides this capability and is more portable than MapScript. I 
think ideally we'd develop
a validator that spits out all errors but that's probably not possible either 
since many common error states
(like a missing END or quote) will trigger a whole bunch of false positives. 
Best to take it an error at a
time for most cases. This might be useful more for between version migration 
where the mapfile is structurally
sound but keywords have changed.

We could write a dumber version of shp2img that only tries to load the mapfile 
and report an error but I'm not
sure it's worth the effort.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ivan Mincik
Sent: Tuesday, May 15, 2012 10:24 AM
To: mapserver-users
Subject: Re: [mapserver-users] Mapfile verification tool

> I don't think this will work because the mapfile is read all at once
> and parsed into an internal data structure. You can't access it in
> mapscript until the parser has read it and the parser will error out on any 
> errors.

Understand, but i mean only valid/invalid output from test script. If some 
error will raised - mapfile is invalid, with no other information where 
otherwise mapfile is OK.


--
Ivan Mincik
___
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 mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Lime, Steve D (DNR)
Shp2img already provides this capability and is more portable than MapScript. I 
think ideally we'd develop 
a validator that spits out all errors but that's probably not possible either 
since many common error states 
(like a missing END or quote) will trigger a whole bunch of false positives. 
Best to take it an error at a 
time for most cases. This might be useful more for between version migration 
where the mapfile is structurally
sound but keywords have changed.

We could write a dumber version of shp2img that only tries to load the mapfile 
and report an error but I'm not
sure it's worth the effort.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ivan Mincik
Sent: Tuesday, May 15, 2012 10:24 AM
To: mapserver-users
Subject: Re: [mapserver-users] Mapfile verification tool

> I don't think this will work because the mapfile is read all at once 
> and parsed into an internal data structure. You can't access it in 
> mapscript until the parser has read it and the parser will error out on any 
> errors.

Understand, but i mean only valid/invalid output from test script. If some 
error will raised - mapfile is invalid, with no other information where 
otherwise mapfile is OK.


--
Ivan Mincik
___
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] Mapfile verification tool

2012-05-15 Thread Ivan Mincik
I mean something like this:

import sys
import mapscript

try:
m = mapscript.mapObj(sys.argv[1])
print 'VALID (%s layers found)' % m.numlayers

except:
print 'INVALID'


I did some tests and it seems working. Even it outputs detailed parsing
error message (for example: loadProjection(): Unknown identifier.
Parsing error near (METADATA):(line 100))
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Ivan Mincik
> I don't think this will work because the mapfile is read all at once and
> parsed into an internal data structure. You can't access it in mapscript
> until the parser has read it and the parser will error out on any errors.

Understand, but i mean only valid/invalid output from test script. If
some error will raised - mapfile is invalid, with no other information
where otherwise mapfile is OK.


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


Re: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Stephen Woodbridge

On 5/15/2012 11:02 AM, Ivan Mincik wrote:

On 05/15/2012 03:56 PM, Lime, Steve D (DNR) wrote:

Other than using shp2img or one of the other command-line executables I'm 
afraid there isn't a validator.



What about writing some trivial mapscript script which will loop over
all layers in mapfile. If some syntax error would be found some
exception will be raised ?




Ivan,

I don't think this will work because the mapfile is read all at once and 
parsed into an internal data structure. You can't access it in mapscript 
until the parser has read it and the parser will error out on any errors.


I think you would need to modify the parser and add some kind of error 
recovery to continue parsing the rest of the file to report additional 
errors.


Currently there is no attempt to recover from an error because we assume 
that the mapfile should be valid in the production environment. For 
development/debugging purposes, you would have to add the error recovery 
code.


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


Re: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Ivan Mincik
On 05/15/2012 03:56 PM, Lime, Steve D (DNR) wrote:
> Other than using shp2img or one of the other command-line executables I'm 
> afraid there isn't a validator.
> 

What about writing some trivial mapscript script which will loop over
all layers in mapfile. If some syntax error would be found some
exception will be raised ?


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


RE: [mapserver-users] Mapfile verification tool

2012-05-15 Thread Lime, Steve D (DNR)
Other than using shp2img or one of the other command-line executables I'm 
afraid there isn't a validator.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Alberto Najera
Sent: Monday, May 14, 2012 8:35 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapfile verification tool

Hello all,

Is there a tool available to check the mapfile syntax?   I am working with a
file that is getting quite large and it is easy to, for example, miss or add an 
"END".

Thanks  

Alberto Najera

___
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] Some Doubts in WMS Time Documentation

2012-05-15 Thread abhishek bansal
Thank You very much for your reply.. I have read that document for like
thousand times but could never understand that. I am still confused because
the layer "time_idx" is polygon type(which is vector type) layer, So how I
will be able to render raster based upon time.
I have my rasters (with tiling) stored in PostGIS 2.0 database.

Thank You
On Tue, May 15, 2012 at 6:18 PM, Paolo Corti  wrote:

> Hi
>
> > 1.) No database table is specified in the raster layer configuration.
> Does
> > that mean my table name would be equal to layer name ?
>
> no, the tiles are fetched from the query in the DATA attribute of the
> time_idx layer:
>
> DATA "the_geom from nexrad_n0r_tindex"
>
> where the_geom is the geometry column, and nexrad_n0r_tindex is the table
> name.
>
> > 2.) Why is there no database connection configuration?
>
> it is in the CONNECTION and CONNETIONTYPE attributes of the time_idx
>  layer.
>
> > 3.) If I am using PostGIS2.0 do I still need to provide "Tile Index" if
> yes
> > how ?
>
> Never tried with 2.0, but nothing should change
> p
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
>



-- 
Thanks & Regards,
Abhishek Bansal
http://abhishekbansal.miyuri.com
Jaypee Institute of Information Technology, Noida
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Some Doubts in WMS Time Documentation

2012-05-15 Thread Paolo Corti
Hi

> 1.) No database table is specified in the raster layer configuration. Does
> that mean my table name would be equal to layer name ?

no, the tiles are fetched from the query in the DATA attribute of the
time_idx layer:

DATA "the_geom from nexrad_n0r_tindex"

where the_geom is the geometry column, and nexrad_n0r_tindex is the table name.

> 2.) Why is there no database connection configuration?

it is in the CONNECTION and CONNETIONTYPE attributes of the time_idx  layer.

> 3.) If I am using PostGIS2.0 do I still need to provide "Tile Index" if yes
> how ?

Never tried with 2.0, but nothing should change
p

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Some Doubts in WMS Time Documentation

2012-05-15 Thread abhishek bansal
hi all,

I am trying to setup a WMS MAP Server for time based query of raster
images. In the given last example (PostGIS One) of this wms time
documentation I had some doubts:

1.) No database table is specified in the raster layer configuration. Does
that mean my table name would be equal to layer name ?
2.) Why is there no database connection configuration?
3.) If I am using PostGIS2.0 do I still need to provide "Tile Index" if yes
how ?

please help

-- 
Thanks & Regards,
Abhishek Bansal
http://abhishekbansal.miyuri.com
Jaypee Institute of Information Technology, Noida
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users