Re: [mapserver-users] PostGIS query errors

2016-11-09 Thread Kralidis, Tom (EC)


> -Original Message-
> From: Andy Colson [mailto:a...@squeakycode.net]
> Sent: 09 November 2016 17:43
> To: Kralidis, Tom (EC); mapserver-users@lists.osgeo.org
> Subject: Re: [mapserver-users] PostGIS query errors
> 
> On 11/9/2016 3:30 PM, Kralidis, Tom (EC) wrote:
> > Hi all: using 7.0.2 against a PostgreSQL 9.3/PostGIS 2.2 instance we're 
> > getting
> query errors.
> >
> > I've posted a Gist at [1] to help in reporting.  Note that this 
> > functionality used
> to work in 6.4.x.
> >
> > From the migration guides it doesn't look like much has changed w.r.t.
> > PostGIS syntax in the mapfile.  Any idea what could be going on here?
> > It looks like the query that is constructed by mappostgis.c is something 
> > like:
> >
> > select
> >
> "stn_nam","avg_wnd_dir_10m_mt58_60","avg_wnd_spd_10m_mt58_60_symb
> ol","
> > air_temp","stn_pres","mslp","dwpt_temp","rel_hum","observation_qa_summ
> >
> ary","observation_qa_problem_summary",encode(ST_AsBinary(ST_Force2D("t
> > he_geom"),'NDR'),'hex') as geom,"data_payload_id" from (select * from
> > data_mart_ca_live order by instance_datetime desc) as subquery where
> > the_geom && ST_GeomFromText('POLYGON((-127.881959628204
> > 63.7547758989546,-127.881959628204 70.5833900726923,-
> 103.751686743445
> > 70.5833900726923,-103.751686743445 63.7547758989546,-
> 127.881959628204
> > 63.7547758989546))',4326) and ()
> >
> > Note the trailing "()".  When I remove the "()" and try direct in psql, the 
> > query
> works.
> >
> > Any idea what could be going on here?
> >
> > Thanks
> >
> > ..Tom
> >
> > [1]
> > https://gist.github.com/tomkralidis/26cb7214e282c144ba61598116d458e7
> > ___
> > mapserver-users mailing list
> > mapserver-users@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> 
> It looks to me, from the code mappostgis.c ~line 2018, in the
> msPostGISBuildSQLWhere function, that you have either a FILTER or
> NATIVE_FILTER being added.  I don't see it in the gist you posted though.  Is 
> it
> applied later some how?  I'd bet it's also empty.
> 

Indeed, it turns out that Python MapScript was doing a setFilter as part of the
workflow (since changed to setProcessingKey).

Thanks

..Tom


> There is a comment about RFC91 too:
> http://mapserver.org/id/development/rfc/ms-rfc-91.html
> 
> any of that apply to you?
> 
> -Andy
> 

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

Re: [mapserver-users] Mapserver - classifying multiple symbol sizes with multiple colours [SEC=UNCLASSIFIED]

2016-11-09 Thread Stephen Woodbridge

STYLE
   SYMBOL 'xyz'
   SIZE [size]
   COLOR [colour]
END

where [colour] is a string "#rrggbb"

-Steve W

On 11/9/2016 6:35 PM, Inna Nogeste wrote:

I need to symbolise data showing both size and colour, where there are 4 
different symbol sizes and 11 different colours. The 11 colours can be applied 
to all 4 different symbol sizes.
Is there an efficient way to code this or do I need to have 44 different 
styles/expressions such as the following:

EXPRESSION ([size] = 1 and [colour] = 0%)
EXPRESSION ([size] = 1 and [colour] = 10%)
EXPRESSION ([size] = 1 and [colour] = 20%)
EXPRESSION ([size] = 1 and [colour] = 30%)
to
EXPRESSION ([size] = 4 and [colour] = 100%)

In addition to this, I also need to scale the symbol [size] for different zoom 
levels which will increase the number of styles/expressions by a factor of at 
least 2 or 3 resulting in at least 88 blocks of code.

Does anyone have any suggestions for the most/a efficient way to code this?

Regards,
Inna Nogeste | Spatial Information Specialist
Geospatial Data and Services
Information Systems and Services Division
Bureau of Meteorology
www.bom.gov.au
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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

[mapserver-users] Mapserver - classifying multiple symbol sizes with multiple colours [SEC=UNCLASSIFIED]

2016-11-09 Thread Inna Nogeste
I need to symbolise data showing both size and colour, where there are 4 
different symbol sizes and 11 different colours. The 11 colours can be applied 
to all 4 different symbol sizes.
Is there an efficient way to code this or do I need to have 44 different 
styles/expressions such as the following:

EXPRESSION ([size] = 1 and [colour] = 0%)
EXPRESSION ([size] = 1 and [colour] = 10%)
EXPRESSION ([size] = 1 and [colour] = 20%)
EXPRESSION ([size] = 1 and [colour] = 30%)
to
EXPRESSION ([size] = 4 and [colour] = 100%)

In addition to this, I also need to scale the symbol [size] for different zoom 
levels which will increase the number of styles/expressions by a factor of at 
least 2 or 3 resulting in at least 88 blocks of code.

Does anyone have any suggestions for the most/a efficient way to code this?

Regards,
Inna Nogeste | Spatial Information Specialist
Geospatial Data and Services
Information Systems and Services Division 
Bureau of Meteorology
www.bom.gov.au
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS query errors

2016-11-09 Thread Andy Colson

On 11/9/2016 3:30 PM, Kralidis, Tom (EC) wrote:

Hi all: using 7.0.2 against a PostgreSQL 9.3/PostGIS 2.2 instance we're getting 
query errors.

I've posted a Gist at [1] to help in reporting.  Note that this functionality 
used to work in 6.4.x.

From the migration guides it doesn't look like much has changed w.r.t. PostGIS 
syntax in
the mapfile.  Any idea what could be going on here?  It looks like the query 
that is constructed
by mappostgis.c is something like:

select 
"stn_nam","avg_wnd_dir_10m_mt58_60","avg_wnd_spd_10m_mt58_60_symbol","air_temp","stn_pres","mslp","dwpt_temp","rel_hum","observation_qa_summary","observation_qa_problem_summary",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex')
 as geom,"data_payload_id" from (select * from data_mart_ca_live order by instance_datetime desc) as subquery where the_geom && ST_GeomFromText('POLYGON((-127.881959628204 
63.7547758989546,-127.881959628204 70.5833900726923,-103.751686743445 70.5833900726923,-103.751686743445 63.7547758989546,-127.881959628204 63.7547758989546))',4326) and ()

Note the trailing "()".  When I remove the "()" and try direct in psql, the 
query works.

Any idea what could be going on here?

Thanks

..Tom

[1] https://gist.github.com/tomkralidis/26cb7214e282c144ba61598116d458e7
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



It looks to me, from the code mappostgis.c ~line 2018, in the 
msPostGISBuildSQLWhere function, that you have either a FILTER or 
NATIVE_FILTER being added.  I don't see it in the gist you posted 
though.  Is it applied later some how?  I'd bet it's also empty.


There is a comment about RFC91 too:
http://mapserver.org/id/development/rfc/ms-rfc-91.html

any of that apply to you?

-Andy


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

Re: [mapserver-users] Converting a v5.6 CGI call to v6.0

2016-11-09 Thread Lime, Steve D (MNIT)
Do you get an actual MapServer error? It sounds like you made the right changes 
relative to the URL.

From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Joel Benford
Sent: Wednesday, November 09, 2016 10:17 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Converting a v5.6 CGI call to v6.0

Hello everybody,

I am maintaining a system for a customer that links to mapserver -- we're not 
mapserver users, they are.

Some time back, when they used mapserver v5.6, we put a partial mapserver CGI 
url in one of their configuration files. The idea was that they could edit it 
if they ever needed to in future, e.g. if they changed sever location for 
mapserver. They later upgraded to mapserver 6.0, but cjust changing the target 
server failed.

The original query substring was along the lines of:

http://someserver.ourcustomer.co.uk/MapServer/cgi-bin5.6/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERYMAP_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring=
  {application adds the rest here depending on what the user wants on that 
invocation}

I looked at the 5.6 to 6.0 migration guide at 
http://www.mapserver.org/MIGRATION_GUIDE.html#mapserver-5-6-to-6-0-migration 
and in the CGI section it says:
All of the query map related modes (e.g. NQUERYMAP, ITEMQUERYMAP, etc...) 
have been removed in favor of using the "qformat" parameter. That parameter 
takes an output format name or mime/type as a value and uses that to process a 
set of query results. For example:
...=nquerymap&... would become ...=nquery=png24&...

So I tried a simple substitution in line with that and changed our substring to:
http:// someserver.ourcustomer.co.uk 
/mapserv6/cgi-bin6.0/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERY_AND_qformat=png24_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring=

...i.e. I changed the target from the 5.6 to 6.0 server and changed 
"mode=ITEMNQUERYMAP" to "mode=ITEMNQUERY_AND_qformat=png24"

This did not meet with success, I got a "Parameter is not valid" error with the 
following stack trace:
[ArgumentException: Parameter is not valid.]
System.Drawing.Image.FromStream(Stream stream, Boolean 
useEmbeddedColorManagement, Boolean validateImageData) +1067179
System.Drawing.Image.FromStream(Stream stream) +8
SurveysReporting.ReportProvider.GenerateReport(ReportName rnName, String 
szShortCode) +4371
Reports_Preview.Page_Load(Object sender, EventArgs e) +374
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object 
t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, 
EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, 
Boolean includeStagesAfterAsyncPoint) +627

Superficially, this error doesn't seem to have much to do with the parameter I 
changed.

At this point, I would like to ask some more experienced mapserver users a few 
questions:


1.   Is my substitution of "mode=ITEMNQUERYMAP" to 
"mode=ITEMNQUERY_AND_qformat=png24" a viable solution in itself?

2.   Does anything else in the amended query substring above jump out as 
incorrect in v6.0?

3.   Does the error message received look like the sort of thing that would 
apply to the rest of the CGI query, i.e. the stuff that's added on the end to 
suit the specific user request?

I'm really hoping for 2, because otherwise I'll have to get our legacy 
application running and then learn mapserver syntax to change what it's sending.

Thanks in advance for any help or advice.

Joel Benford


The information contained in or attached to this message is the responsibility 
of the sender and is meant for the confidential use of the intended recipients. 
It does not necessarily represent the position of Aligned Assets. If you are 
not an intended recipient you are notified that you have received this 
communication in error and that review, dissemination or copying of this 
communication is prohibited.
If you have received this in error, please notify us.
Aligned Assets Limited
Unit 5
River Court
Albert Drive
Sheerwater
Woking
GU21 5RP
Company Registration No: 4610724

___

[mapserver-users] PostGIS query errors

2016-11-09 Thread Kralidis, Tom (EC)
Hi all: using 7.0.2 against a PostgreSQL 9.3/PostGIS 2.2 instance we're getting 
query errors.

I've posted a Gist at [1] to help in reporting.  Note that this functionality 
used to work in 6.4.x.

From the migration guides it doesn't look like much has changed w.r.t. PostGIS 
syntax in
the mapfile.  Any idea what could be going on here?  It looks like the query 
that is constructed
by mappostgis.c is something like:

select 
"stn_nam","avg_wnd_dir_10m_mt58_60","avg_wnd_spd_10m_mt58_60_symbol","air_temp","stn_pres","mslp","dwpt_temp","rel_hum","observation_qa_summary","observation_qa_problem_summary",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex')
 as geom,"data_payload_id" from (select * from data_mart_ca_live order by 
instance_datetime desc) as subquery where the_geom && 
ST_GeomFromText('POLYGON((-127.881959628204 63.7547758989546,-127.881959628204 
70.5833900726923,-103.751686743445 70.5833900726923,-103.751686743445 
63.7547758989546,-127.881959628204 63.7547758989546))',4326) and ()

Note the trailing "()".  When I remove the "()" and try direct in psql, the 
query works.

Any idea what could be going on here?

Thanks

..Tom

[1] https://gist.github.com/tomkralidis/26cb7214e282c144ba61598116d458e7
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Converting a v5.6 CGI call to v6.0

2016-11-09 Thread Joel Benford
Hello everybody,

I am maintaining a system for a customer that links to mapserver -- we're not 
mapserver users, they are.

Some time back, when they used mapserver v5.6, we put a partial mapserver CGI 
url in one of their configuration files. The idea was that they could edit it 
if they ever needed to in future, e.g. if they changed sever location for 
mapserver. They later upgraded to mapserver 6.0, but cjust changing the target 
server failed.

The original query substring was along the lines of:

http://someserver.ourcustomer.co.uk/MapServer/cgi-bin5.6/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERYMAP_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring=
  {application adds the rest here depending on what the user wants on that 
invocation}

I looked at the 5.6 to 6.0 migration guide at 
http://www.mapserver.org/MIGRATION_GUIDE.html#mapserver-5-6-to-6-0-migration 
and in the CGI section it says:
All of the query map related modes (e.g. NQUERYMAP, ITEMQUERYMAP, etc...) 
have been removed in favor of using the "qformat" parameter. That parameter 
takes an output format name or mime/type as a value and uses that to process a 
set of query results. For example:
...=nquerymap&... would become ...=nquery=png24&...

So I tried a simple substitution in line with that and changed our substring to:
http:// someserver.ourcustomer.co.uk 
/mapserv6/cgi-bin6.0/mapserv.exe?map=D:\Maps\CCC\Intranet52\_MapServerConfig\Surveys.map_AND_mode=ITEMNQUERY_AND_qformat=png24_AND_qlayer=Buildings_AND_map.layer%5bBuildings%5d=TEMPLATE+'_MapServerTemplates\Buildings_fields.xml'_AND_qitem=SHORT_CODE_EMS_AND_qstring=

...i.e. I changed the target from the 5.6 to 6.0 server and changed 
"mode=ITEMNQUERYMAP" to "mode=ITEMNQUERY_AND_qformat=png24"

This did not meet with success, I got a "Parameter is not valid" error with the 
following stack trace:
[ArgumentException: Parameter is not valid.]
System.Drawing.Image.FromStream(Stream stream, Boolean 
useEmbeddedColorManagement, Boolean validateImageData) +1067179
System.Drawing.Image.FromStream(Stream stream) +8
SurveysReporting.ReportProvider.GenerateReport(ReportName rnName, String 
szShortCode) +4371
Reports_Preview.Page_Load(Object sender, EventArgs e) +374
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object 
t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, 
EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, 
Boolean includeStagesAfterAsyncPoint) +627

Superficially, this error doesn't seem to have much to do with the parameter I 
changed.

At this point, I would like to ask some more experienced mapserver users a few 
questions:


1.   Is my substitution of "mode=ITEMNQUERYMAP" to 
"mode=ITEMNQUERY_AND_qformat=png24" a viable solution in itself?

2.   Does anything else in the amended query substring above jump out as 
incorrect in v6.0?

3.   Does the error message received look like the sort of thing that would 
apply to the rest of the CGI query, i.e. the stuff that's added on the end to 
suit the specific user request?

I'm really hoping for 2, because otherwise I'll have to get our legacy 
application running and then learn mapserver syntax to change what it's sending.

Thanks in advance for any help or advice.

Joel Benford


The information contained in or attached to this message is the responsibility 
of the sender and is meant for the confidential use of the intended recipients. 
It does not necessarily represent the position of Aligned Assets. If you are 
not an intended recipient you are notified that you have received this 
communication in error and that review, dissemination or copying of this 
communication is prohibited.
If you have received this in error, please notify us.
Aligned Assets Limited
Unit 5
River Court
Albert Drive
Sheerwater
Woking
GU21 5RP
Company Registration No: 4610724

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