Re: [mapserver-users] Use STYLEITEM to style individual features?

2012-11-29 Thread Alexander Schenkel
Dear Tamas,

Thanks, I will do so. So if I understand correctly, it should work if we
use the SYMBBOL index instead of the name?

so e.g.:

STYLE
SIZE 10
COLOR 135 255 135
OUTLINEWIDTH 2
OUTLINECOLOR 0 0 0
SYMBOL 2 # ('filled square' is the 2nd symbon in our symboldef file)
END

instead of 

STYLE
SIZE 10
COLOR 135 255 135
OUTLINEWIDTH 2
OUTLINECOLOR 0 0 0
SYMBOL 'filled square'
END

Unfortunately, this is also not working. And, as also written in my first post, 
it IS indeed working on class level, so if we surround our style definition 
with a CLASS ... END tag, but, yeah, this is not what we want as all those 
classes then gets defined and applied to all features.

So I will file a bug, but perhaps this is not the root of the problem?

Thanks
alex



Am 29.11.12 22:36, schrieb Tamas Szekeres:
> Alex,
>
> This is indeed a bug in mapserver, symbol indexes are not resolved from
> symbol names when updating a style from string. You might want to file a
> ticket and assign that to me in the github issue
> tracker
> .
>
> Best regards,
>
> Tamas
>
>
>
> 2012/11/29 Alexander Schenkel 
>
>> Dear all,
>>
>> We have the following setup:
>>
>> Our features come as DB records out of a PostGIS 1.5 database, which
>> contains a column "mapserver_style" besides other data columns. We want
>> to use that column to style the individual features.
>>
>> Since MapServer 6.0 (we use 6.0.2), the Mapserver LAYER config knows the
>> "STYLEITEM" configuration attribute, which takes the name of an
>> item (DB column, in our case), and, according to the documentation,
>> should contain a STYLE ...END string.
>>
>> This seems not to be working or we use it the wrong way. Our Mapfile's
>> LAYER definition looks as follows (cleaned out
>> all irrelevant information):
>>
>>
>> ##
>> LAYER
>>   NAME layername
>>   DATA "wkb_geometry from (SELECT
>> wkb_geometry,mapserver_style,some_other_data) as foo using SRID=21781,
>> using unique ogc_fid"
>>
>>   TYPE POINT
>>   STATUS ON
>>   OPACITY 100
>>   DUMP TRUE
>>   STYLEITEM "mapserver_style"
>>
>>   CLASS
>>   END
>> END
>> ##
>>
>> while "mapserver_style" corresponds to the database column containing
>> the "STYLE  END" string.
>>
>> As an example, the "mapserver_style" column for a single feature contains:
>>
>> STYLE
>> SIZE 10
>> COLOR 135 255 135
>> OUTLINEWIDTH 2
>> OUTLINECOLOR 0 0 0
>> SYMBOL 'filled square'
>> END
>>
>> which does NOT draw any visible feature on the map.
>>
>> If we just surround this example with "CLASS  END", it basically
>> works, BUT the class(es) then match every single feature, leading to
>> overlapping feature symbols
>> for every single feature appearing after the class has been defined:
>>
>> CLASS
>> STYLE
>> SIZE 10
>> COLOR 135 255 135
>> OUTLINEWIDTH 2
>> OUTLINECOLOR 0 0 0
>> SYMBOL 'filled square'
>> END
>> END
>>
>> So can anybody tell us how we can style features on a per-feature basis
>> using the STYLEITEM config? Or is this the wrong way?
>>
>> Many thanks for your support,
>>
>> alex
>>
>>
>>
>>
>> ___
>> 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] Use STYLEITEM to style individual features?

2012-11-29 Thread Tamas Szekeres
Alex,

This is indeed a bug in mapserver, symbol indexes are not resolved from
symbol names when updating a style from string. You might want to file a
ticket and assign that to me in the github issue
tracker
.

Best regards,

Tamas



2012/11/29 Alexander Schenkel 

> Dear all,
>
> We have the following setup:
>
> Our features come as DB records out of a PostGIS 1.5 database, which
> contains a column "mapserver_style" besides other data columns. We want
> to use that column to style the individual features.
>
> Since MapServer 6.0 (we use 6.0.2), the Mapserver LAYER config knows the
> "STYLEITEM" configuration attribute, which takes the name of an
> item (DB column, in our case), and, according to the documentation,
> should contain a STYLE ...END string.
>
> This seems not to be working or we use it the wrong way. Our Mapfile's
> LAYER definition looks as follows (cleaned out
> all irrelevant information):
>
>
> ##
> LAYER
>   NAME layername
>   DATA "wkb_geometry from (SELECT
> wkb_geometry,mapserver_style,some_other_data) as foo using SRID=21781,
> using unique ogc_fid"
>
>   TYPE POINT
>   STATUS ON
>   OPACITY 100
>   DUMP TRUE
>   STYLEITEM "mapserver_style"
>
>   CLASS
>   END
> END
> ##
>
> while "mapserver_style" corresponds to the database column containing
> the "STYLE  END" string.
>
> As an example, the "mapserver_style" column for a single feature contains:
>
> STYLE
> SIZE 10
> COLOR 135 255 135
> OUTLINEWIDTH 2
> OUTLINECOLOR 0 0 0
> SYMBOL 'filled square'
> END
>
> which does NOT draw any visible feature on the map.
>
> If we just surround this example with "CLASS  END", it basically
> works, BUT the class(es) then match every single feature, leading to
> overlapping feature symbols
> for every single feature appearing after the class has been defined:
>
> CLASS
> STYLE
> SIZE 10
> COLOR 135 255 135
> OUTLINEWIDTH 2
> OUTLINECOLOR 0 0 0
> SYMBOL 'filled square'
> END
> END
>
> So can anybody tell us how we can style features on a per-feature basis
> using the STYLEITEM config? Or is this the wrong way?
>
> Many thanks for your support,
>
> alex
>
>
>
>
> ___
> 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] Problem with attribute query, multiple attributes

2012-11-29 Thread Bistrais, Bob
I tried a few things and have an interesting result-

After trying the file GDB with multiple attributes, and no success there, I 
tried Jeff's suggestion and used a shapefile of the parcels, and added an 
index.  I know that conventional wisdom says shapefile is a poor choice, but 
when I tried it, I got a query result within 7 or 8 seconds.  So while this 
might not be the recommended approach, it gets the job done.

Thanks Jeff!



-Original Message-
From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] 
Sent: Thursday, November 29, 2012 11:03 AM
To: Fawcett, David (MPCA); Bistrais, Bob; Jeff McKenna; 
mapserver-users@lists.osgeo.org
Subject: RE: [mapserver-users] Problem with attribute query, multiple attributes

Honestly I don't think an index is going to help unless the attribute filter is 
being passed to OGR processing. I'm not familiar enough with that driver to 
know if that's done or not. Usually attribute queries are written a form the 
driver understands. For PostGIS that means a bit of a where clause, for 
Shapefiles it's the normal expression syntax. Again, not sure about OGR.

With large shapefiles attribute queries are inefficient, usually requiring full 
table scans. Bob's example:

  queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))";

will guarantee a full scan because the expression is invalid. The same feature 
can't have two values for TOWN.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Fawcett, David 
(MPCA)
Sent: Thursday, November 29, 2012 9:10 AM
To: Bistrais, Bob; Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Since OGR accesses the GDB via ESRI's API/Library, it may (should) take 
advantage of attribute indexes built on the data with ArcMap.  

You should make sure that the feature classes in the GDB have attribute indexes 
on any column that you want to use as query criteria and that they have good 
spatial indexes as well.  

If you don't have access to ESRI tools, you will likely want to pre-process the 
data by dumping it from the GDB to shapefiles or PostGIS, where you can create 
all of the indexes that you need.  

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: Thursday, November 29, 2012 8:45 AM
To: Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Thanks Jeff.  That link shows how to build an index on a shapefile.  Is there 
an equivalent for File GDB?  I'm looking at the GDAL document for GDB now, not 
seeing an index description.

-Original Message-
From: Jeff McKenna [mailto:jmcke...@gatewaygeomatics.com]
Sent: Wednesday, November 28, 2012 6:41 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

On 12-11-28 5:43 PM, Bistrais, Bob wrote:
> I am trying to set up an attribute query for a large parcel dataset 
> (about 550,000 polygons).  I am having trouble with the query 
> exceeding the 30 second limit.
> 
>  
> 
> I am trying to query on the map_bk_lot and town attributes.  I can 
> query on either one separately and get results, but I need to query on 
> both at the same time.
> 
>  
> 
> Here is my query expression:
> 
> $queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))"; 
> ---Hardcoded for testing now, will eventually use variables
> 
> $pLayer->queryByAttributes("MAP_BK_LOT",$queryExp,MS_SINGLE);   
> Query statement
> 
>  
> 
> The data is in an ESRI File GDB.  I am using MS4w 3.0.4m MapServer 
> 6.0.2, MapScript 6.1 for PHP
> 
>  
> 
> One other thing worth mentioning- if I use a small subset of features 
> (such as a town), the query will work without timing out.  But I'm no 
> longer convinced that dataset size is the problem since it will query 
> on one attribute.
> 
>  
> 
> Any ideas what's going wrong here?

A tip that might come in handy someday, if not in this case, could be to create 
an "attribute index" on your vector field (see example in 
http://www.gdal.org/ogr/drv_shapefile.html); I've done this before and it's 
improved attribute queries in MapServer significantly.  You can generate one 
through an ogrinfo command with the "sql" switch.

Sorry I cannot provide exact FileGDB examples at the moment.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/



___
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] Use STYLEITEM to style individual features?

2012-11-29 Thread Alexander Schenkel
Dear all,

We have the following setup:

Our features come as DB records out of a PostGIS 1.5 database, which
contains a column "mapserver_style" besides other data columns. We want
to use that column to style the individual features.

Since MapServer 6.0 (we use 6.0.2), the Mapserver LAYER config knows the
"STYLEITEM" configuration attribute, which takes the name of an
item (DB column, in our case), and, according to the documentation,
should contain a STYLE ...END string.

This seems not to be working or we use it the wrong way. Our Mapfile's
LAYER definition looks as follows (cleaned out
all irrelevant information):


##
LAYER
  NAME layername
  DATA "wkb_geometry from (SELECT
wkb_geometry,mapserver_style,some_other_data) as foo using SRID=21781,
using unique ogc_fid"
 
  TYPE POINT
  STATUS ON
  OPACITY 100
  DUMP TRUE
  STYLEITEM "mapserver_style"

  CLASS
  END
END
##

while "mapserver_style" corresponds to the database column containing
the "STYLE  END" string.

As an example, the "mapserver_style" column for a single feature contains:

STYLE
SIZE 10
COLOR 135 255 135
OUTLINEWIDTH 2
OUTLINECOLOR 0 0 0
SYMBOL 'filled square'
END

which does NOT draw any visible feature on the map.

If we just surround this example with "CLASS  END", it basically
works, BUT the class(es) then match every single feature, leading to
overlapping feature symbols
for every single feature appearing after the class has been defined:

CLASS
STYLE
SIZE 10
COLOR 135 255 135
OUTLINEWIDTH 2
OUTLINECOLOR 0 0 0
SYMBOL 'filled square'
END
END

So can anybody tell us how we can style features on a per-feature basis
using the STYLEITEM config? Or is this the wrong way?

Many thanks for your support,

alex




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


Re: [mapserver-users] Problem with attribute query, multiple attributes

2012-11-29 Thread Bistrais, Bob
Whoops!  I sent the wrong expression, and I acknowledge that one was incorrect. 
 Here is the correct expression:

$queryExp = "(('[MAP_BK_LOT]' == '007-042') AND ('[TOWN]' == 'Acton'))";

-So we're selecting on items map_bk_lot and town.  And again, I'm not using a 
shapefile here, it's a featureclass in an ESRI File Geodatabase.


-Original Message-
From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] 
Sent: Thursday, November 29, 2012 11:03 AM
To: Fawcett, David (MPCA); Bistrais, Bob; Jeff McKenna; 
mapserver-users@lists.osgeo.org
Subject: RE: [mapserver-users] Problem with attribute query, multiple attributes

Honestly I don't think an index is going to help unless the attribute filter is 
being passed to OGR processing. I'm not familiar enough with that driver to 
know if that's done or not. Usually attribute queries are written a form the 
driver understands. For PostGIS that means a bit of a where clause, for 
Shapefiles it's the normal expression syntax. Again, not sure about OGR.

With large shapefiles attribute queries are inefficient, usually requiring full 
table scans. Bob's example:

  queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))";

will guarantee a full scan because the expression is invalid. The same feature 
can't have two values for TOWN.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Fawcett, David 
(MPCA)
Sent: Thursday, November 29, 2012 9:10 AM
To: Bistrais, Bob; Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Since OGR accesses the GDB via ESRI's API/Library, it may (should) take 
advantage of attribute indexes built on the data with ArcMap.  

You should make sure that the feature classes in the GDB have attribute indexes 
on any column that you want to use as query criteria and that they have good 
spatial indexes as well.  

If you don't have access to ESRI tools, you will likely want to pre-process the 
data by dumping it from the GDB to shapefiles or PostGIS, where you can create 
all of the indexes that you need.  

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: Thursday, November 29, 2012 8:45 AM
To: Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Thanks Jeff.  That link shows how to build an index on a shapefile.  Is there 
an equivalent for File GDB?  I'm looking at the GDAL document for GDB now, not 
seeing an index description.

-Original Message-
From: Jeff McKenna [mailto:jmcke...@gatewaygeomatics.com]
Sent: Wednesday, November 28, 2012 6:41 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

On 12-11-28 5:43 PM, Bistrais, Bob wrote:
> I am trying to set up an attribute query for a large parcel dataset 
> (about 550,000 polygons).  I am having trouble with the query 
> exceeding the 30 second limit.
> 
>  
> 
> I am trying to query on the map_bk_lot and town attributes.  I can 
> query on either one separately and get results, but I need to query on 
> both at the same time.
> 
>  
> 
> Here is my query expression:
> 
> $queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))"; 
> ---Hardcoded for testing now, will eventually use variables
> 
> $pLayer->queryByAttributes("MAP_BK_LOT",$queryExp,MS_SINGLE);   
> Query statement
> 
>  
> 
> The data is in an ESRI File GDB.  I am using MS4w 3.0.4m MapServer 
> 6.0.2, MapScript 6.1 for PHP
> 
>  
> 
> One other thing worth mentioning- if I use a small subset of features 
> (such as a town), the query will work without timing out.  But I'm no 
> longer convinced that dataset size is the problem since it will query 
> on one attribute.
> 
>  
> 
> Any ideas what's going wrong here?

A tip that might come in handy someday, if not in this case, could be to create 
an "attribute index" on your vector field (see example in 
http://www.gdal.org/ogr/drv_shapefile.html); I've done this before and it's 
improved attribute queries in MapServer significantly.  You can generate one 
through an ogrinfo command with the "sql" switch.

Sorry I cannot provide exact FileGDB examples at the moment.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/



___
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.or

Re: [mapserver-users] Problem with attribute query, multiple attributes

2012-11-29 Thread Lime, Steve D (DNR)
Honestly I don't think an index is going to help unless the attribute filter is 
being passed to OGR processing. I'm not familiar enough with that driver to 
know if that's done or not. Usually attribute queries are written a form the 
driver understands. For PostGIS that means a bit of a where clause, for 
Shapefiles it's the normal expression syntax. Again, not sure about OGR.

With large shapefiles attribute queries are inefficient, usually requiring full 
table scans. Bob's example:

  queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))";

will guarantee a full scan because the expression is invalid. The same feature 
can't have two values for TOWN.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Fawcett, David 
(MPCA)
Sent: Thursday, November 29, 2012 9:10 AM
To: Bistrais, Bob; Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Since OGR accesses the GDB via ESRI's API/Library, it may (should) take 
advantage of attribute indexes built on the data with ArcMap.  

You should make sure that the feature classes in the GDB have attribute indexes 
on any column that you want to use as query criteria and that they have good 
spatial indexes as well.  

If you don't have access to ESRI tools, you will likely want to pre-process the 
data by dumping it from the GDB to shapefiles or PostGIS, where you can create 
all of the indexes that you need.  

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: Thursday, November 29, 2012 8:45 AM
To: Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Thanks Jeff.  That link shows how to build an index on a shapefile.  Is there 
an equivalent for File GDB?  I'm looking at the GDAL document for GDB now, not 
seeing an index description.

-Original Message-
From: Jeff McKenna [mailto:jmcke...@gatewaygeomatics.com]
Sent: Wednesday, November 28, 2012 6:41 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

On 12-11-28 5:43 PM, Bistrais, Bob wrote:
> I am trying to set up an attribute query for a large parcel dataset 
> (about 550,000 polygons).  I am having trouble with the query 
> exceeding the 30 second limit.
> 
>  
> 
> I am trying to query on the map_bk_lot and town attributes.  I can 
> query on either one separately and get results, but I need to query on 
> both at the same time.
> 
>  
> 
> Here is my query expression:
> 
> $queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))"; 
> ---Hardcoded for testing now, will eventually use variables
> 
> $pLayer->queryByAttributes("MAP_BK_LOT",$queryExp,MS_SINGLE);   
> Query statement
> 
>  
> 
> The data is in an ESRI File GDB.  I am using MS4w 3.0.4m MapServer 
> 6.0.2, MapScript 6.1 for PHP
> 
>  
> 
> One other thing worth mentioning- if I use a small subset of features 
> (such as a town), the query will work without timing out.  But I'm no 
> longer convinced that dataset size is the problem since it will query 
> on one attribute.
> 
>  
> 
> Any ideas what's going wrong here?

A tip that might come in handy someday, if not in this case, could be to create 
an "attribute index" on your vector field (see example in 
http://www.gdal.org/ogr/drv_shapefile.html); I've done this before and it's 
improved attribute queries in MapServer significantly.  You can generate one 
through an ogrinfo command with the "sql" switch.

Sorry I cannot provide exact FileGDB examples at the moment.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/



___
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] EXPRESSION error with MapServer 6.2

2012-11-29 Thread Jeff Lake

shot in the dark ..
But I believe the error your getting in an actual MySQL error ..
your table name is a bit long ...

-Jeff Lake
MichiganWxSystem.com
AllisonHouse.com
TheWeatherCenter.net
GRLevelXStuff.com

On 11/29/2012 10:16, Astrid Emde wrote:

Hello,

I have a MapServer 6.2 question. I run MapServer 6.2 on Windows Server 2008.

I noticed a strange behaviour with the EXPRESSION definition while I am
migrating my mapfiles to MapServer 6.0

This is my table:
CREATE TABLE ax_bauwerkoderanlagefuerindustrieundgewerbe
(
   ogc_fid serial NOT NULL,
   gml_id character(16), -- Identifikator, global eindeutig
   ...
   bauwerksfunktion integer,
   wkb_geometry geometry
   ...
);


DATA "wkb_geometry from (SELECT ogc_fid, bauwerksfunktion, wkb_geometry
FROM ax_bauwerkoderanlagefuerindustrieundgewerbe) as foo using unique
ogc_fid USING SRID=25832"

As bauwerksfunktion is an integer column my EXPRESSION definition was like
this in MaServer < 6.0

EXPRESSION ([bauwerksfunktion] = 1210)
EXPRESSION ([bauwerksfunktion] = 1215 OR [bauwerksfunktion] = 1220 OR
[bauwerksfunktion] = 1250 OR [bauwerksfunktion] = 1260)

Now with MapServer 6.2 it does not work anymore:
* instead of a map I get an Internal Server Error

My Logfile says:
[Thu Nov 29 15:03:31 2012].824000 msEvalExpression(): General error
message. Invalid item index.

I also checked http://mapserver.org/mapfile/expressions.html

Does anyone has an idea?



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


Re: [mapserver-users] EXPRESSION error with MapServer 6.2

2012-11-29 Thread Lime, Steve D (DNR)
Hmmm... Seems like bug. There weren't any major changes to the EXPRESSION code 
but I imagine at least small modifications were made. I have access to similar 
data here, let me try a local test.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Astrid Emde
Sent: Thursday, November 29, 2012 9:16 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] EXPRESSION error with MapServer 6.2

Hello,

I have a MapServer 6.2 question. I run MapServer 6.2 on Windows Server 2008.

I noticed a strange behaviour with the EXPRESSION definition while I am 
migrating my mapfiles to MapServer 6.0

This is my table:
CREATE TABLE ax_bauwerkoderanlagefuerindustrieundgewerbe
(
  ogc_fid serial NOT NULL,
  gml_id character(16), -- Identifikator, global eindeutig
  ...
  bauwerksfunktion integer,
  wkb_geometry geometry
  ...
);


DATA "wkb_geometry from (SELECT ogc_fid, bauwerksfunktion, wkb_geometry FROM 
ax_bauwerkoderanlagefuerindustrieundgewerbe) as foo using unique ogc_fid USING 
SRID=25832"

As bauwerksfunktion is an integer column my EXPRESSION definition was like this 
in MaServer < 6.0

EXPRESSION ([bauwerksfunktion] = 1210)
EXPRESSION ([bauwerksfunktion] = 1215 OR [bauwerksfunktion] = 1220 OR 
[bauwerksfunktion] = 1250 OR [bauwerksfunktion] = 1260)

Now with MapServer 6.2 it does not work anymore:
* instead of a map I get an Internal Server Error

My Logfile says:
[Thu Nov 29 15:03:31 2012].824000 msEvalExpression(): General error message. 
Invalid item index.

I also checked http://mapserver.org/mapfile/expressions.html

Does anyone has an idea?

--
Thanks for your help

Astrid Emde

..
FOSSGIS 2013, Die Konferenz für Open Source GIS mit OpenData und OpenStreetMap 
erstmals in der Schweiz!
12.-14. Juni, HSR, Rapperswil, http://www.fossgis.de 
..


___
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] Problem with attribute query, multiple attributes

2012-11-29 Thread Fawcett, David (MPCA)
Since OGR accesses the GDB via ESRI's API/Library, it may (should) take 
advantage of attribute indexes built on the data with ArcMap.  

You should make sure that the feature classes in the GDB have attribute indexes 
on any column that you want to use as query criteria and that they have good 
spatial indexes as well.  

If you don't have access to ESRI tools, you will likely want to pre-process the 
data by dumping it from the GDB to shapefiles or PostGIS, where you can create 
all of the indexes that you need.  

David.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: Thursday, November 29, 2012 8:45 AM
To: Jeff McKenna; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

Thanks Jeff.  That link shows how to build an index on a shapefile.  Is there 
an equivalent for File GDB?  I'm looking at the GDAL document for GDB now, not 
seeing an index description.

-Original Message-
From: Jeff McKenna [mailto:jmcke...@gatewaygeomatics.com]
Sent: Wednesday, November 28, 2012 6:41 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

On 12-11-28 5:43 PM, Bistrais, Bob wrote:
> I am trying to set up an attribute query for a large parcel dataset 
> (about 550,000 polygons).  I am having trouble with the query 
> exceeding the 30 second limit.
> 
>  
> 
> I am trying to query on the map_bk_lot and town attributes.  I can 
> query on either one separately and get results, but I need to query on 
> both at the same time.
> 
>  
> 
> Here is my query expression:
> 
> $queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))"; 
> ---Hardcoded for testing now, will eventually use variables
> 
> $pLayer->queryByAttributes("MAP_BK_LOT",$queryExp,MS_SINGLE);   
> Query statement
> 
>  
> 
> The data is in an ESRI File GDB.  I am using MS4w 3.0.4m MapServer 
> 6.0.2, MapScript 6.1 for PHP
> 
>  
> 
> One other thing worth mentioning- if I use a small subset of features 
> (such as a town), the query will work without timing out.  But I'm no 
> longer convinced that dataset size is the problem since it will query 
> on one attribute.
> 
>  
> 
> Any ideas what's going wrong here?

A tip that might come in handy someday, if not in this case, could be to create 
an "attribute index" on your vector field (see example in 
http://www.gdal.org/ogr/drv_shapefile.html); I've done this before and it's 
improved attribute queries in MapServer significantly.  You can generate one 
through an ogrinfo command with the "sql" switch.

Sorry I cannot provide exact FileGDB examples at the moment.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/



___
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] Problem with attribute query, multiple attributes

2012-11-29 Thread Bistrais, Bob
Thanks Jeff.  That link shows how to build an index on a shapefile.  Is there 
an equivalent for File GDB?  I'm looking at the GDAL document for GDB now, not 
seeing an index description.

-Original Message-
From: Jeff McKenna [mailto:jmcke...@gatewaygeomatics.com] 
Sent: Wednesday, November 28, 2012 6:41 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Problem with attribute query, multiple attributes

On 12-11-28 5:43 PM, Bistrais, Bob wrote:
> I am trying to set up an attribute query for a large parcel dataset 
> (about 550,000 polygons).  I am having trouble with the query 
> exceeding the 30 second limit.
> 
>  
> 
> I am trying to query on the map_bk_lot and town attributes.  I can 
> query on either one separately and get results, but I need to query on 
> both at the same time.
> 
>  
> 
> Here is my query expression:
> 
> $queryExp = "('[TOWN]' == '007-042') AND ('[TOWN]' == 'Acton'))"; 
> ---Hardcoded for testing now, will eventually use variables
> 
> $pLayer->queryByAttributes("MAP_BK_LOT",$queryExp,MS_SINGLE);   
> Query statement
> 
>  
> 
> The data is in an ESRI File GDB.  I am using MS4w 3.0.4m MapServer 
> 6.0.2, MapScript 6.1 for PHP
> 
>  
> 
> One other thing worth mentioning- if I use a small subset of features 
> (such as a town), the query will work without timing out.  But I'm no 
> longer convinced that dataset size is the problem since it will query 
> on one attribute.
> 
>  
> 
> Any ideas what's going wrong here?

A tip that might come in handy someday, if not in this case, could be to create 
an "attribute index" on your vector field (see example in 
http://www.gdal.org/ogr/drv_shapefile.html); I've done this before and it's 
improved attribute queries in MapServer significantly.  You can generate one 
through an ogrinfo command with the "sql" switch.

Sorry I cannot provide exact FileGDB examples at the moment.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/



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


[mapserver-users] EXPRESSION error with MapServer 6.2

2012-11-29 Thread Astrid Emde
Hello,

I have a MapServer 6.2 question. I run MapServer 6.2 on Windows Server 2008.

I noticed a strange behaviour with the EXPRESSION definition while I am
migrating my mapfiles to MapServer 6.0

This is my table:
CREATE TABLE ax_bauwerkoderanlagefuerindustrieundgewerbe
(
  ogc_fid serial NOT NULL,
  gml_id character(16), -- Identifikator, global eindeutig
  ...
  bauwerksfunktion integer,
  wkb_geometry geometry
  ...
);


DATA "wkb_geometry from (SELECT ogc_fid, bauwerksfunktion, wkb_geometry
FROM ax_bauwerkoderanlagefuerindustrieundgewerbe) as foo using unique
ogc_fid USING SRID=25832"

As bauwerksfunktion is an integer column my EXPRESSION definition was like
this in MaServer < 6.0

EXPRESSION ([bauwerksfunktion] = 1210)
EXPRESSION ([bauwerksfunktion] = 1215 OR [bauwerksfunktion] = 1220 OR
[bauwerksfunktion] = 1250 OR [bauwerksfunktion] = 1260)

Now with MapServer 6.2 it does not work anymore:
* instead of a map I get an Internal Server Error

My Logfile says:
[Thu Nov 29 15:03:31 2012].824000 msEvalExpression(): General error
message. Invalid item index.

I also checked http://mapserver.org/mapfile/expressions.html

Does anyone has an idea?

-- 
Thanks for your help

Astrid Emde

..
FOSSGIS 2013, Die Konferenz für Open Source GIS mit OpenData und
OpenStreetMap erstmals in der Schweiz!
12.-14. Juni, HSR, Rapperswil, http://www.fossgis.de
..


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


Re: [mapserver-users] msLoadMap(): Unable to access file.

2012-11-29 Thread Jörg Thomsen
Hi,

mapserver tells you what's wrong:
> msLoadMap(): Unable to access file.
> (/home/sangitas/softwares/ex1/world_mapfile.map)

as your online-resource contains 'mapserv.exe' i think you are working
on windows. The path to your mapfile looks like unix-path. On windows it
should look like

c:\path to your mapfile\yourmapfile.map

regards, Jörg


> while opening the following link from the browser
>  
> http://10.210.43.209/cgi-bin/mapserv?map=/home/sangitas/softwares/ex1/world_mapfile.map
>  
> where as http://10.210.43.209/cgi-bin/mapserv
> 
>  link
> works as expected.
>  
> I made the changes in the map file as followes
>  
>  *'wms_onlineresource' 
> 'http://localhost/cgi-bin/mapserv.exe?map=/home/sangitas/softwares/ex1/world_mapfile.map&;'*
> 
>  
> 
> LAYER
> 
> NAME 'world_raster'
> 
> TYPE RASTER
> 
> *DATA '/home/sangitas/softwares/ex1/img/world_raster.tif'*
> 
> ** 
> 
> LAYER
> 
> NAME 'world_adm0'
> 
> TYPE POLYGON
> 
> *DATA '/home/sangitas/softwares/ex1/data/world_adm0.shp'*
> 
>  
>  
> Also added following in httpd.conf
>  
> 
> Options Indexes MultiViews FollowSymLinks
> AllowOverride all
> Allow from all
> Order allow,deny
> 
> 
>  AllowOverride all
> Allow from all
> 
> 
> AllowOverride all
> Allow from all
> 
>  
> Request you to guide me to run this so that I can move further & try the
> same application with openlayers.
> 
>  
> 
>  
> 
> *Thanks & Regards,*
> 
> *Sangita *
> 
> 
> ~~Disclaimer~~~
> Information contained and transmitted by this e-mail is confidential and
> proprietary to iGATE and its affiliates and is intended for use only by
> the recipient. If you are not the intended recipient, you are hereby
> notified that any dissemination, distribution, copying or use of this
> e-mail is strictly prohibited and you are requested to delete this
> e-mail immediately and notify the originator or mailad...@igate.com
> . iGATE does not enter into any agreement
> with any party by e-mail. Any views expressed by an individual do not
> necessarily reflect the view of iGATE. iGATE is not responsible for the
> consequences of any actions taken on the basis of information provided,
> through this email. The contents of an attachment to this e-mail may
> contain software viruses, which could damage your own computer system.
> While iGATE has taken every reasonable precaution to minimise this risk,
> we cannot accept liability for any damage which you sustain as a result
> of software viruses. You should carry out your own virus checks before
> opening an attachment. To know more about iGATE please visit
> www.igate.com .
> 
> 
> 
> 
> ___
> 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] (no subject)

2012-11-29 Thread St St

to: aho forum.email.a at googlemail.com 


If the map is not draw in OpenLayers and in there is no
tinyows-log entry and the reponse is something with “no valix XML”: try to
disable the XML-schema-check in tinyows (check_schema=”0”). If the WFS is then
displayed in OpenLayers then you have some problems with the schema-validation
in lxml (libxml2). 
Schema-validation should be enabled for security reasons!
 
Check if you have underscores in your layer names. 
layername is the feature name which can be different from
the table name in the DB. 
 name="pipelinesegment
"

table=" pipeline_segment "
without underscores in the schema-check should be fine ->
turn schema check on again.
 
(from: https://github.com/mapserver/mapserver/issues/4205 )
 
HTH

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