Re: [MapServer-users] [EXTERNAL] Two regular expressions

2023-02-08 Thread Schylberg Lars
Hi,

You need to use a CLASSITEM

LAYER
  ...
  CLASSITEM "LANGUAGE"

  CLASS
EXPRESSION /^GERMAN$/
...
EXPRESSION /^FRENCH$/
 ...
...

Have fun / Lars S.

From: MapServer-users  On Behalf Of 
Preuß, Sylvia
Sent: den 8 februari 2023 08:24
To: 'mapserver-users@lists.osgeo.org' 
Subject: [EXTERNAL] [MapServer-users] Two regular expressions

Hello,

is it possible to do something like that with a regular expression
MAP...
EXPRESSION ('[LANGUAGE]' eq 'GERMAN' OR '[LANGUAGE]' eq 'FRENCH')?
...END

my regular expressions include ^ and $:

EXPRESSION /^RMA$/
EXPRESSION /^RENC$/

Thanks
sylviaobk



Der E-Mail-Dienst des Oberbergischen Kreises dient ausschließlich der 
dienstlichen Kommunikation.
Senden Sie deshalb keine E-Mails privaten Inhalts an E-Mail-Adressen des 
Oberbergischen Kreises.
Es wird darauf hingewiesen, dass neben der Person, an die Ihre E-Mail gerichtet 
ist, auch deren Vertretung im Amt einen unmittelbaren Zugriff auf Ihre 
Nachricht hat. Für Berufsgeheimnisträger und besondere Funktionsträger gelten 
abweichende Regelungen.
Es wird außerdem darauf hingewiesen, dass die Kommunikation per E-Mail ohne 
Authentifizierung und Verschlüsselung unsicher ist, da für unberechtigte Dritte 
grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht.
Es wird deshalb keine Verantwortung für den Inhalt dieser Nachricht übernommen, 
da eine Manipulation nicht ausgeschlossen werden kann.
Obwohl alle angemessenen Vorkehrungen getroffen wurden, um sicherzustellen, 
dass Anlagen dieser E-Mail virusgeprüft sind, wird empfohlen, anhängende 
Dateien vor dem Öffnen durch Ihr eigenes Virus-Programm zu prüfen, da keinerlei 
Haftung für Schäden übernommen wird, die infolge etwaiger Software-Viren 
entstehen könnten.
Der Inhalt dieser E-Mail ist ausschließlich für die bezeichnete Person 
bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen 
Vertretung sein sollten, beachten Sie bitte, dass jede Form der Kenntnisnahme, 
Veröffentlichung, Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail 
unzulässig ist. In diesem Fall wird darum gebeten, sich mit der absendenden 
Person der E-Mail in Verbindung zu setzen.

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


Re: [MapServer-users] [EXTERNAL] Vector tileindex with connectiontype OGR

2022-12-07 Thread Schylberg Lars
Hi,

I remember that I did tileindexes for vector layers a couple  of years ago.
I can’t find my example right now, but I think I was following this example for 
raster.
The important thing is to have a one layer for the actual tile index, that has 
status off and one layer that is using the tile index layer. In my case I did 
it with sqlite if remember correctly.   I believe I was following this example 
for raster, but did it  with vector data.

https://github.com/mapserver/mapserver/wiki/MapServer-TILEINDEXes-with-Database-RASTERS

https://lists.osgeo.org/pipermail/mapserver-users/2014-August/076877.html

Have fun / Lars Schyberg


From: MapServer-users  On Behalf Of 
Peter Schmitt
Sent: den 7 december 2022 00:56
To: Mapserver-Users (mapserver-users@lists.osgeo.org) 

Subject: [EXTERNAL] [MapServer-users] Vector tileindex with connectiontype OGR

Hi,

How do I get a vector tileindex working with another Mapserver layer as the 
tileindex?

I have the following tindex.geojson:

{ 
"type":"FeatureCollection","features":[{"type":"Feature","properties":{"location":"/app/mapfiles/test.geojson"},"geometry":{"type":"Polygon","coordinates":[[[122.013774753,29.96355712],[122.014247522,29.915620561],[122.06927508,29.916020438],[122.068828693,29.963957768],[122.013774753,29.96355712]]]}}]}

Which points to a single file /app/mapfiles/test.geojson:

{"type":"Feature","properties":{},"geometry":{"coordinates":[[[122.04067791363536,29.944772490597998],[122.03620089848994,29.94141730774004],[122.03819740524398,29.937852301951125],[122.0446709271447,29.938166866424368],[122.04648593328471,29.940211511256464],[122.04067791363536,29.944772490597998]]],"type":"Polygon"}}

I would like to define the TILEINDEX as one MapServer Layer and have another 
MapServer layer reference that tile index.  I tried this layer:

  LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
  END

but when I run `mapserv -nh 
QUERY_STRING='service=WFS=1.0.0=getfeature=/app/mapfiles/test2.map=vector_via_ogr=geojson'`,
 I get the following error:

"msOGRFileOpen(): OGR error. Open failed for OGR connection in layer 
`vector_via_ogr.  File not found or unsupported format. Check server logs."

If I run without CONNECTIONTYPE OGR, I get the following error:

"msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be a shapefile."

I can get a similar thing working for a TILEINDEX of rasters. However I cannot 
get it working on a TILEINDEX of vectors.  The example below is the simplest 
reproduce case I could create.  Ultimately I plan on having a TILEINDEX point 
to a layer of defined via CONNECTIONTYPE postgis.

How do I get a vector tileindex working with another Mapserver layer as the 
tileindex?

Thanks!
Pete


Full mapfile below with example commands reproducing my errors.

MAP
  OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
MIMETYPE "application/json; subtype=geojson"
FORMATOPTION "STORAGE=memory"
FORMATOPTION "FORM=SIMPLE"
FORMATOPTION "LCO:RFC7946=NO"
FORMATOPTION "FILENAME=result.json"
  END

  WEB
METADATA
  "ows_enable_request"  "*"
  "wfs_getfeature_formatlist"   "ogrgml,geojson"
END
  END
  CONFIG "MS_ERRORFILE" "stderr"

  PROJECTION
"init=epsg:4326"
  END

DEBUG 5

  # mapserv -nh 
QUERY_STRING='service=WFS=1.0.0=getfeature=/app/mapfiles/test2.map=vector_directly=geojson'
  # returns the contents of 'test.geojson'!
  LAYER
NAME "vector_directly"
TYPE POLYGON
TILEINDEX "/app/mapfiles/tindex.geojson"
CONNECTIONTYPE OGR
STATUS OFF
  END

  # mapserv -nh 
QUERY_STRING='service=WFS=1.0.0=getfeature=/app/mapfiles/test2.map=tindex_ogr=geojson'
  # returns contents of tindex.geojson!
  LAYER
NAME "tindex_ogr"
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "/app/mapfiles/tindex.geojson"
STATUS OFF
  END

  # mapserv -nh 
QUERY_STRING='service=WFS=1.0.0=getfeature=/app/mapfiles/test2.map=vector_tindex=geojson'
  # returns 'msTiledSHPOpenFile(): Shapefile error. Tileindex layer must be a 
shapefile.'
  LAYER
NAME "vector_via_tindex"
TYPE POLYGON
TILEINDEX tindex_ogr
STATUS OFF
  END

  #  mapserv -nh 
QUERY_STRING='service=WFS=1.0.0=getfeature=/app/mapfiles/test2.map=vector_via_ogr=geojson'
  # returns 'msOGRFileOpen(): OGR error. Open failed for OGR connection in 
layer `vector_via_ogr.  File not found or unsupported format. Check server 
logs.'
  LAYER
NAME "vector_via_ogr"
TYPE POLYGON
TILEINDEX tindex_ogr
CONNECTIONTYPE OGR
STATUS OFF
  END

END # mapfile
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] [EXTERNAL] Re: WMS GetCapabilities map minx, miny etc transposed

2022-11-28 Thread Schylberg Lars
Hi,  I guess it is the old problem with axis order between WMS 1.1.1 and WMS 
1.3.0

Daniel Morissette wrote about the problem long time ago.

http://dmorissette.blogspot.com/2012/12/dont-upgrade-to-wms-130-unless-you.html

/Lars S.


From: MapServer-users  On Behalf Of 
Jody Klymak
Sent: den 27 november 2022 23:59
To: mapserver-users@lists.osgeo.org
Subject: [EXTERNAL] Re: [MapServer-users] WMS GetCapabilities map minx, miny 
etc transposed

Hi Bjørn



On Nov 27, 2022, at 2:21 PM, Bjørn Ove Grøtan 
mailto:bjorn@grotan.com>> wrote:

It's "request=GetMap" not "request=Map”.

Ooops, that indeed works!

However, it is still somewhat strange that GetAttributes x and y are swapped in 
the BoundingBox

Thanks,   Jody


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


Re: [mapserver-users] How to make label background transparent?

2019-03-11 Thread Schylberg Lars
Hi again,

What happens if You skip the IMAGECOLOR statement ?
I did a project a year ago with a lot of transparent layers.   
But I can't see that I used any IMAGECOLOR statements in that case.
I did however use predefined 256 color palettes for another reason.

/Lars

-Original Message-
From: mapserver-users  On Behalf Of 
Stephen Woodbridge
Sent: den 11 mars 2019 16:25
To: lars.schylb...@blixtmail.se; mapserver-users 

Subject: Re: [mapserver-users] How to make label background transparent?

Hi Lars,

Thank you for the feedback on this. Let me clarify what I'm trying to do. I 
have a shape file with contour lines in it. I drawing this as an overlay image 
so the background is transparent. In the mapfile the IMAGECOLOR sets the 
background color and this is the color that is identified as transparent. So in 
a PNG image the background color is set in the first slot of the color table 
and marked as transparent. In my case this is color #ff, but if I create 
labelpoly and assign it as #ff then another slot in the color table is 
allocated and assigned the color #ff but not the first slot that was 
allocated for the background, so it shows up as white.

In my image I have a contour line drawn and when it is labeled the contour line 
goes through the text of the label. If I use the labelpoly then a white 
background for the label is shown hiding the contour line. 
This is what I want to happen only I want the labelpoly color to be the same 
color slot as the background color to it hides the contour line behind the 
label like the white case but is transparent instead of white. IE: it needs to 
write the label poly with the first slot color, not the new white color slot.

I think, setting the COLOR -1 -1 -1 was intended to do this, but maybe not.

Attached are two small images:

contour.png - shows the contour line through the label text with labelpoly 
color #FF00 or color -1 -1 -1 contour-white.png - show labelpoly color 
#FF

-Steve W

On 3/11/2019 5:25 AM, lars.schylb...@blixtmail.se wrote:
> Hi Steve,
>
> I am not sure what your use of IMAGECOLOR has to do here.  Normally I 
> have some layers in between the background and the elevation lines.
>
> But there are two more ways do get the color to be transparent in Mapserver:
>
> STYLE
>GEOMTRANSFORM 'labelpoly'
>COLOR "#ff00"
> END
>
> or
>
> STYLE
>GEOMTRANSFORM 'labelpoly'
>COLOR 255 255 255
>OPACITY 0
> END
>
>
> But those are doing the same thing as your solution below with COLOR 
> -1 -1 -1
>
> Maybe You are after some of the potential techniques that Thomas 
> talked about a couple of years ago with layer blending with the label 
> cache. Those were some future techniques that could be added to the layer 
> composite pipeline if anyone was interested.
>
> Best regards
>
> Lars Schylberg



---
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
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Polygons 3D effect

2016-03-18 Thread Schylberg Lars
Thomas B. described how to do it in this post:

http://lists.osgeo.org/pipermail/mapserver-dev/2015-October/014614.html

It is just available today if You compile master branch yourself, since it was 
developed after the 7.0 release.

/Lars Schylberg

==
Hi,

Draw a shadow below the polygon with something like this

CLASS
MAXSCALEDENOM 11000
STYLE
COLOR "#AB9E89"
OFFSET 1 1
END
STYLE
COLOR "#AB9E89"
END
END
CLASS
   STYLE
COLOR "#AB9E89"
OUTLINECOLOR "#AB9E89"
WIDTH 0.5
END
END

Style is probably made by Thomas Bonfort for OSM buildings.

-Jukka Rahkonen-

Marco Afonso wrote:

Hello all,

How to get a 3D style effect or a shadow effect for Polygons? The idea is to 
give a user feeling of 3D effect.

Thanks!

--
Best Regards,
Marco Afonso
http://goo.gl/ZDtQjm
[Lähettäjä poisti kuvan.]
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapcache - optimum format for orthophotos?

2015-10-14 Thread Schylberg Lars
There is even more details how to optimize the data if You read the blog entry 
from Paul R.

http://blog.cleverelephant.ca/2015/02/geotiff-compression-for-dummies.html

/Lars S.

From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Travis Kirstine
Sent: den 14 oktober 2015 14:24
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Mapcache - optimum format for orthophotos?

This is worth a read as well for info on how to optimize your images for 
mapserver.

http://mapserver.org/uk/optimization/raster.html




On Wed, Oct 14, 2015 at 6:56 AM, thomas bonfort 
> wrote:
it depends on many factors... large metatiles are more efficient as
they usually impose less load on the WMS server, but can cause a
significant delay for the end user if you are populating your cache on
demand.
If you're preseeding everything, use large power of 2 metatiles (4x4,
8x8,...). If you haven't pre-seeded, use smaller ones, how small
depends on the experience you want to provide your user if the tile
isn't already in the cache (2x2, 4x4).
If you're rendering raster data only, you don't need a metabuffer.

On 13 October 2015 at 22:15, Robert Sanson
> wrote:
> Thanks Thomas. I do not have labels, so would you still recommend metatiles 
> for performance reasons? Would you suggest 3 3 or 5 5 for a Mapserver WMS 
> backend?
>
> 3 3
>
> Robert
>
> -Original Message-
> From: thomas bonfort 
> [mailto:thomas.bonf...@gmail.com]
> Sent: Tuesday, 13 October 2015 8:07 p.m.
> To: Robert Sanson 
> >
> Cc: mapserver-users@lists.osgeo.org
> Subject: Re: [mapserver-users] Mapcache - optimum format for orthophotos?
>
> in the vast majority of the cases, you'll want to have mapcache use 
> metatiles, be serving PNGs from your WMS server (image/png 
> in your mapcache ), and storing your tiles as JPG 
> (JPG in your ). If you need to preserve 
> transparency on your orthophoto edges, you can choose to store the tiles as 
> a"mixed" format instead of pure JPG.
>
> --
> thomas
>
> On 12 October 2015 at 22:13, Robert Sanson 
> > wrote:
>> Hi
>>
>> What is the recommended format for serving and storing true colour 
>> orthophotos via Mapcache if we wish to preserve maximum detail? The source 
>> data are uncompressed GeoTiffs served as WMS by Mapserver.
>>
>> Many thanks,
>>
>> Robert Sanson
>> ___
>> 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



--
[FBS Logo]


Travis Kirstine, Web Development Supervisor
t 905‑477‑3600 x 301 | m 647‑534‑4798 | 
tkirst...@firstbasesolution.com

First Base Solutions Inc.
140 Renfrew Drive, Suite 100 | Markham | Ontario | L3R 6B3
t 905‑477‑3600 | f 905‑477‑0892 | 
www.firstbasesolutions.com


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

Re: [mapserver-users] Incompatibility at Filter - level between mapserver 6.x and the last mapserver-dev ?

2015-06-09 Thread Schylberg Lars
It seems like You have a typing error.

  FILTER ([CODICE[ = 107)

Should be:

  FILTER ([CODICE] = 107)

/Lars

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Andrea Peri
Sent: den 9 juni 2015 11:34
To: Eichner, Andreas - SID
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Incompatibility at Filter - level between 
mapserver 6.x and the last mapserver-dev ?

Thx for response.

I try this,
FILTER (CODICE = 107)
and also this
FILTER ([CODICE[ = 107)
and removing the filteritem,

but still go in error:
:(

The log report this:

[Tue Jun  9 11:29:53 2015].880265 LayerDefaultTranslateFilter():
General error message. This data driver does not implement filter translation 
support [Tue Jun  9 11:29:53 2015].955070 msEvalExpression(): General error 
message. Cannot evaluate expression, no item index defined.

2015-06-09 11:06 GMT+02:00 Eichner, Andreas - SID
andreas.eich...@sid.sachsen.de:
 I think you should use

 FILTER ([CODICE] = 107)

 i.e. without using FILTERITEM and the leading WHERE

 -Ursprüngliche Nachricht-
 Von: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users- 
 boun...@lists.osgeo.org] Im Auftrag von Andrea Peri
 Gesendet: Dienstag, 9. Juni 2015 10:45
 An: mapserver-users@lists.osgeo.org
 Betreff: [mapserver-users] Incompatibility at Filter - level between 
 mapserver 6.x and the last mapserver-dev ?

 Hi,
 I have just update my mapserver to the last mapserver-dev .

 After this update, I see an error on the filtering.

 In my mapfile the data configuration was originally this:

 CONNECTION /path-to-spatialite-db/zz_db_tematici.sqlite
 CONNECTIONTYPE OGR
 DATA IFT2009
 EXTENT 1554650.74 4678225.52 1771822.76 4924891.9
 FILTER WHERE ([CODICE] = 107)
 FILTERITEM CODICE
   


 The log report this error:

 [Tue Jun  9 10:39:46 2015].153296 msDrawMap(): rendering using 
 outputformat named AGGA (AGG/PNG).
 [Tue Jun  9 10:39:46 2015].154698 msDrawMap(): WMS/WFS set-up and 
 query, 0.001s [Tue Jun  9 10:39:46 2015].262330 
 LayerDefaultTranslateFilter():
 General error message. This data driver does not implement filter 
 translation support [Tue Jun  9 10:39:46 2015].282402 msDrawMap(): 
 Layer 239 (rt_ucs.idift.rt.107), 0.128s [Tue Jun  9 10:39:46 
 2015].282550 msDrawMap(): Drawing Label Cache, 0.000s

 I'm using spatialite as db.

 After this error, I read this RFC:
 http://www.mapserver.org/ru/development/rfc/ms-rfc-91.html

 And try the new settings,

 FILTER (([FILTERITEM[ = string) AND (CODICE = 107))

 but it seem don't work.

 I don't understand if this is an issue of the new settings with 
 spatialite or I'm wrong something.

 Thx,


 --
 -
 Andrea Peri
 . . . . . . . . .
 qwerty àèìòù
 -
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
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] KML Multigeometry

2015-04-27 Thread Schylberg Lars
The linestrings and point are inside a geometrycollection.
There is no FID that You can use to make the selection.

I would suggest that You experiment with ogrinfo first to see that You can 
extract what You want.

I guess that You have to make a more advanced sql query to break the 
geometrycollection appart into the two linestrings and the point feature.
You can do that both with regular ogr sql or sqlite syntax in ogr.

/Lars


From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 24 april 2015 17:57
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] KML Multigeometry

Hi,

Need help!!  I have a kml with multigeometry placemark in it as shown below. 
Also I have create a map file corresponding to this kml as shown.
I am unable to view the data on map, there is no error coming. Please let me 
know what wrong i am doing.

MAP
-

LAYER
GROUP default
NAME layer0
DATA SELECT * FROM 'TestFolder' WHERE FID=0 AND OGR_GEOMETRY='LINESTRING'
METADATA
wms_title Layer_0
gml_geometries geom
gml_include_items all
wms_include_items all
wms_feature_info_mime_type text/plain
gml_geom_type line
END
STATUS DEFAULT
TEMPLATE queryable
TYPE LINE
CONNECTIONTYPE OGR
CONNECTION test.kml
CLASS
NAME class
STYLE
WIDTH 10
COLOR 0 0 255
END #style end
END #class end
END #layerend
END

KML
--
?xml version=1.0 encoding=UTF-8?
kml xmlns=http://www.opengis.net/kml/2.2; 
xmlns:gx=http://www.google.com/kml/ext/2.2; 
xmlns:kml=http://www.opengis.net/kml/2.2; 
xmlns:atom=http://www.w3.org/2005/Atom;

Document
Folder
 nameTestFolder/name
Placemark
  nameSF Marina Harbor Master/name
  visibility0/visibility
  MultiGeometry
LineString
  !-- north wall --
  coordinates
  -71.460218,42.901764,1 -71.460193,42.901815,1 -71.460095,42.902058,1 
-71.460027,42.902381,1 -71.460009,42.902723,1 
-71.460016,42.903507,1 -71.459988,42.904164,1 
-71.459951,42.904524,1 -71.4598540001,42.905083,1 
-71.459458,42.906672,1 -71.459121,42.907851,1 -71.4588410001,42.908847,1 
-71.4587630001,42.909122,1
  /coordinates
/LineString
LineString
  !-- south wall --
  coordinates
-122.4425509770566,37.80662588061205,0
-122.4428340530617,37.8065999493009,0
  /coordinates
/LineString
Point
coordinates-122.4428340530617,37.8065999493009,0/coordinates
/Point
  /MultiGeometry
/Placemark
/Folder
/Document
/kml



Thanks!

--

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

Re: [mapserver-users] polygon fill

2015-03-18 Thread Schylberg Lars
Hi,

Without looking at the your details I remember one blog entry that might help.

http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/

another relevant link seems to be

http://trac.osgeo.org/openlayers/wiki/Highlighting

/Lars

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of rishi
Sent: den 16 mars 2015 10:54
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] polygon fill

hi all

iam trying to highlight the villages based on query

but only one polygon is highlighting
the query is based on the area of the villages, when user enters area 
=** ,it is displaying 13 villages in the grid and also same time it 
has to highlight the villages on the map
my code is

aspx page

 protected void btnselect_Click(object sender, EventArgs e)
{

string query = ;

query = String.Format( select gid,box(geom),villname,geom,area(geom) 
from villages where area(geom)  + ddlsymb.SelectedValue ++ txtarea.Text 
+  );

dt = MyClass.getData(query);

if (dt == null || dt.Rows.Count == 0)
{
Response.Write(No record found, Try Zoom in and click close to 
feature.);
}
else
{
dr = dt.Rows[0];
//String selectedGID = dr[gid].ToString();

//gid = selectedGID;
var layername = villages;

for(int i=0;idt.Rows.Count;i++)
{
 dr = dt.Rows[i];
 String selectedGID = dr[gid].ToString();

 gid = selectedGID;

Response.Write(String.Format(@scriptwindow.parent.highlightnav('{0}','{1}');/script,
 gid, layername));
//Locate(query);
}

if (dt.Columns.Contains(gid))
{
dt.Columns.Remove(gid);
}
if (dt.Columns.Contains(geom))
{
dt.Columns.Remove(geom);
}
GridView1.DataSource = dt;
GridView1.DataBind();
}
}


js page

function highlightnav(gid,layername)
{

bPoint.params.gid = gid;
bPoint.params.tbl = layername;
//bPoint.params.getElementById = geom;
bPoint.redraw();
}


mapfile bpoint.map

MAP
  EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947
  TRANSPARENT on
  IMAGETYPE png
  SIZE 450 500
  SYMBOLSET symbols.txt


web
metadata
wms_srs EPSG:4326 EPSG:900913
end
end



  LAYER
CONNECTIONTYPE postgis
CONNECTION user=postgres password=** dbname=mpdb port=5432
DATA geom FROM (select geom,gid from %tbl% where gid=%gid%)as foo 
using srid=900913 using unique gid

STATUS Default
TYPE point

PROJECTION
  init=epsg:900913
END


class
style

symbol 'line20'
color 255 0 0
size 10
end
end
END
END


i created for loop, to highlight all the polygons, but it is highlighting only 
one polygon.
 plz tell me the code





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

Re: [mapserver-users] How use a spatialite as tileindex for raster

2015-03-18 Thread Schylberg Lars
Hi 

Looking at your old example I became curious.  Did You use gdaltindex to create 
the indexfile in spatialite or did You do in some other way?
The -f option in gdaltindex seems like a rather recent addition that I haven't 
tried. 

/Lars

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Rahkonen Jukka 
(MML)
Sent: den 16 mars 2015 17:25
To: Andrea Peri; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] How use a spatialite as tileindex for raster

Hi Andrea,

I share your feelings, it is odd. Therefore I wrote this mail and now when I am 
lost I can search for spatialite ogr tileindex rahkonen

http://osgeo-org.1560.x6.nabble.com/How-to-use-Spatialite-as-a-TILEINDEX-td4228164.html

-Jukka Rahkonen-





Andrea Peri wrote:

 Hi,
reading the mapserver docs,
I understand that is possible to use every OGR datasource to access a raster 
catalog using tileindex.

 So I try to use a spatialite as tileindex.

 I try this setting but without success.

NAME rt_ofc2k.ofc2k
STATUS OFF
EXTENT 555870.99 4677465.00 752890.00 4924883.05
TYPE raster
CONNECTIONTYPE OGR
CONNECTION /pth-to-spatialite/db.sqlite
TILEINDEX 'table'
TILEITEM 'location'

The error reported from log is:

[Mon Mar 16 16:49:58 2015].129679 msShapefileOpen(): Unable to access file. 
(/home//table)

Perhaps is not true that an OGR spatialite can be used as tileindex source ?

Thx,

--
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
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] Calculate length!

2015-03-16 Thread Schylberg Lars
I guess this must be a version problem.  That same command runs fine on my 
osgeolive8 machine.

ogrinfo --version
GDAL 1.10.1, released 2013/08/26

/Lars


From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 16 mars 2015 09:54
To: Rahkonen Jukka (MML); mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Calculate length!

Hi Jukka,

When i am trying to run the above ogr command as mentioned by you I am getting 
an error

ogrinfo -dialect sqlite -sql select st_length(geometry) from 'Fibertech 
solution' doc_test.kml
INFO: Open of `doc_test.kml'
  using driver `LIBKML' successful.
ERROR 1: In ExecuteSQL(): sqlite3_prepare(select st_length(geometry) from 
'Fibertech solution'):
  no such function: st_length



Please let me know what the issue is. I have installed both libsqlite3 and 
libspatialite.

Thanks!
Alok


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

Re: [mapserver-users] Calculate length!

2015-03-15 Thread Schylberg Lars
Hi Jukka,

You were right about that is possible to calculate length of a line in a KML 
file in Mapserver via ogr and sqlite.
It is possible with a VRT file. I had some weekend fun learning. This will be 
useful in another project I am doing!

The only trouble I found, was that I could not get the relativeToVRT=1 to work 
when I did an inline specification of the ovf in the mapfile.
The only way to get the inline ScrDataSource specification to work  was to use 
a full path description to the kml file location.
In most cases I like to use relative location specifications.
Shapepath specification in the mapfile didn’t help

/Lars

Example follows:

Make a ovf-file: doc_test.ovf

OGRVRTDataSource
   OGRVRTLayer name='doc_test'
   SrcDataSource relativeToVRT=1./doc_test.kml/SrcDataSource
   SrcSQL dialect='sqlite'
 select geometry,
 Name,
 cast(OGR_STYLE as chartater(32)) as 'LINE_STYLE',
 cast(ST_length(geometry, 4857) as integer(12)) as 'DISTANCE'
 FROM 'Fibertech solution'
 where ST_GeometryType(geometry) LIKE 'LINESTRING%'/SrcSQL
  /OGRVRTLayer
/OGRVRTDataSource

The class from the new mapfile.


  LAYER
CONNECTIONTYPE OGR
CONNECTION doc_test.ovf
DATA 'doc_test'
NAME kml_example
GROUP LINES
TYPE LINE
STATUS ON
CLASSITEM LINE_STYLE
CLASS
  EXPRESSION @msn_ylw-pushpin4
  STYLE
COLOR 250 0 0
WIDTH 2.5
  END
  LABEL
TEXT (Distance:  + '[DISTANCE]' + ' meters ' + '#' + '[Name]')
WRAP '#'
SIZE MEDIUM
COLOR 255 100 100
POSITION AUTO
  END
END
…….


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

Re: [mapserver-users] Calculate length!

2015-03-13 Thread Schylberg Lars
As far as I know there is no length function in Mapserver.
The only geometry function to use in Expressions is area(shape).
OGR sql doesn’t provide that either as far as I can see in the documentation.

So the solutions might be to convert your KML data to  sqlite or postgis where 
such functions are available.

The length of a string (number of characters in the string) can be found in OGR 
sql with the length function,
but I am assuming You are looking for the geometric length of the linestring.

/Lars

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 13 mars 2015 07:01
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Calculate length!

Hi,

I want to calculate the length in mapserver. Is it possible. Means i have a 
linestring and i want to know the length for it.
Also not could be suggest me how to do it.

I am using data source to mapserver as KML.

Thanks!

--

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

Re: [mapserver-users] Calculate length!

2015-03-13 Thread Schylberg Lars
Hi Jukka,

That is right and that is why I wrote about conversion to spatialite.
Next questions is when it gets interesting.

How can I get Mapserver to understand that it is sqlite dialect in the DATA 
statement?
If this would be the case:

CONNECTIONTYPE OGR
CONNECTION doc_test.kml
DATA select st_length(geometry) from line_demo limit 5

As far as I understand it defaults to regular OGR sql.
I was looking for an answer a couple of months ago but didn’t find any solution.

Somewhere I have seen that pszDialect can be set to SQLITE.
But can that be done in the mapfile?

I have also seen in old message from You about a undocumented workaround with 
VRT
Is that the solution?

I have a similar issue myself where I would like work against another OGR 
format but with sqlite syntax.

/Lars

From: Rahkonen Jukka (MML) [mailto:jukka.rahko...@maanmittauslaitos.fi]
Sent: den 13 mars 2015 10:58
To: Schylberg Lars; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Calculate length!

Hi Lars,

You should not underestimate GDAL.  Read 
http://www.gdal.org/ogr_sql_sqlite.html and look at this:

ogrinfo -dialect sqlite -sql select st_length(geometry) from line_demo limit 
5 line_demo.shp
INFO: Open of `line_demo.shp'
  using driver `ESRI Shapefile' successful.

Layer name: SELECT
Geometry: None
Feature Count: 10
Layer SRS WKT:
(unknown)
st_length(geometry): Real (0.0)
OGRFeature(SELECT):0
  st_length(geometry) (Real) = 638.237633730745
OGRFeature(SELECT):1
  st_length(geometry) (Real) = 32.7179011265525
OGRFeature(SELECT):2
  st_length(geometry) (Real) = 4399.43983906202
OGRFeature(SELECT):3
  st_length(geometry) (Real) = 480.395511976145
OGRFeature(SELECT):4
  st_length(geometry) (Real) = 311.309421824364
-Jukka Rahkonen-


Schylberg Lars wrote:

As far as I know there is no length function in Mapserver.
The only geometry function to use in Expressions is area(shape).
OGR sql doesn’t provide that either as far as I can see in the documentation.

So the solutions might be to convert your KML data to  sqlite or postgis where 
such functions are available.

The length of a string (number of characters in the string) can be found in OGR 
sql with the length function,
but I am assuming You are looking for the geometric length of the linestring.

/Lars

From: 
mapserver-users-boun...@lists.osgeo.orgmailto:mapserver-users-boun...@lists.osgeo.org
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 13 mars 2015 07:01
To: mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Calculate length!

Hi,

I want to calculate the length in mapserver. Is it possible. Means i have a 
linestring and i want to know the length for it.
Also not could be suggest me how to do it.

I am using data source to mapserver as KML.

Thanks!

--

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

Re: [mapserver-users] KML reading through OGR

2015-03-12 Thread Schylberg Lars
The OGR style is the variable that is returned in the variable that is casted.
Please look at the Layer definitions that I sent yesterday in the mapfile 
example.


DATA SELECT Name as NAME, CAST(OGR_STYLE AS character(32)) AS STYLE FROM 
'Fibertech solution' WHERE OGR_GEOMETRY='LINESTRING'

CLASSITEM STYLE

LABELITEM NAME



CLASS

 EXPRESSION @msn_ylw-pushpin4


That is the STYLE value used in the CLASSITEM expression.

The description is shown in the label that uses the labelitem.  Also shown in 
the mapfile example yesterday.


If You only want to get the features with the style ‘@msn_ylw-pushpin4' with 
ogrinfo you should write it like this:

ogrinfo -ro doc_test.kml \
-sql SELECT *, CAST(OGR_STYLE AS character(255)) AS STYLE FROM 'Fibertech 
solution' \
WHERE OGR_GEOMETRY='LINESTRING' AND OGR_STYLE='@msn_ylw-pushpin4' –al

That returns the geometry and variables according to this criteria, i.e. only 
lines and specific style.

But I guess that You most likely would like to do this filtering in the Class 
section of the mapfile and not in the DATA statement.

/Lars


From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 11 mars 2015 05:46
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] KML reading through OGR

Hi,

I am unable to get the Styleurl using Ogrinfo. I am trying the command
ogrinfo -al doc_test.kml -where ogr_style='@msn_ylw-pushpin4'

but the result is
Layer name: Fibertech solution
Geometry: 3D Unknown (any)
Feature Count: 0
Layer SRS WKT:
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.257223563,
AUTHORITY[EPSG,7030]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0,
AUTHORITY[EPSG,8901]],
UNIT[degree,0.0174532925199433,
AUTHORITY[EPSG,9108]],
AUTHORITY[EPSG,4326]]
Name: String (0.0)
Description: String (0.0)



Also i want to show the description of placemark on map.

Thanks!
[https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif]

--

Alok Mathur | Software Engineer 2A | Ciena
Mobile +91 9899413266
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] KML reading through OGR

2015-03-12 Thread Schylberg Lars


From: alok mathur [mailto:mathuralok...@gmail.com]
Sent: den 12 mars 2015 10:57
To: Schylberg Lars
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] KML reading through OGR
You have to create symbol definitions to use in the mapfile:

Plenty of examples on this page:

http://mapserver.org/mapfile/symbology/construction.html#symbols-of-type-pixmap

/Lars

I want to create a styling for each placemark  in .map file. Means If i have a 
KML containing one folder with multiple placemarks as shown below. I want to 
create a .map file which will contain style for each placemark.
What if i have the same names of placemarks. Please help me to get the solution

Eg.


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

Re: [mapserver-users] KML in mapserver

2015-03-10 Thread Schylberg Lars
This was a good exercise to handle KML files.

To get this to work You have to cast the Style value to a string also.

DATA SELECT Name as NAME, CAST(OGR_STYLE AS character(32)) AS STYLE FROM 
'Fibertech solution' WHERE OGR_GEOMETRY='LINESTRING'

The Mapfile should something like this:

# Start of LAYER DEFINITIONS -
  LAYER
NAME kml_example
GROUP LINES
TYPE LINE
STATUS ON
CONNECTIONTYPE OGR
CONNECTION doc_test.kml
DATA SELECT Name as NAME, CAST(OGR_STYLE AS character(32)) AS STYLE 
FROM 'Fibertech solution' WHERE OGR_GEOMETRY='LINESTRING'
CLASSITEM STYLE
LABELITEM NAME

CLASS
# EXPRESSION ([STYLE] = '@msn_ylw-pushpin4')
 EXPRESSION @msn_ylw-pushpin4
  NAME Fiber Names 4
  STYLE
COLOR 250 0 0
   WIDTH 2.5
 END
  LABEL
SIZE TINY
COLOR 255 100 100
POSITION AUTO
  END
END  

CLASS
# EXPRESSION ([STYLE] = '@msn_ylw-pushpin8')
  EXPRESSION @msn_ylw-pushpin8
  NAME Fiber Names 8
  STYLE
COLOR 0 255 0
WIDTH 3.1
  END
  LABEL
SIZE TINY
COLOR 100 255 100
POSITION AUTO
  END 
END # Class
  END # Layer

  LAYER
NAME kml_example_point
GROUP PONITS
TYPE POINT
STATUS DEFAULT
CONNECTIONTYPE OGR
CONNECTION doc_test.kml
DATA SELECT * FROM 'Fibertech solution' WHERE OGR_GEOMETRY='POINT'
LABELITEM Name
CLASS
  #NAME Fiber Names
  STYLE
COLOR 0 0 255
SYMBOL 'circlef'
SIZE 16
  END
END  # Class
  END # Layer
END # Map


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


Re: [mapserver-users] Best Practice

2015-03-10 Thread Schylberg Lars
I would write a bash script that starts with using ogrinfo.
Extract all relevant information from ogrinfo with sed, awk and similar tools.
Print the mapfile content of the fly from the bash script with a lot of printf 
commands
Quick method in my opinion!

Here is a small extract from an example I did a couple of weeks ago:

#!/bin/sh
#
# Argument parsing depending on your needs.
#
# eg. KML_FILE is set from argument 1
# MAPFILE is argument 2
#
#  Process EXTENT for the mapfile
#
shopt -s lastpipe
ogrinfo -ro $KML_FILE -al \
| grep Extent | egrep -o '[0-9.]+' | readarray BBOX
minx=`echo ${BBOX[0]} | tr -d '\n'`
miny=`echo ${BBOX[1]} | tr -d '\n'`
maxx=`echo ${BBOX[2]} | tr -d '\n'`
maxy=`echo ${BBOX[3]} | tr -d '\n'`
#
#  Print header part of mapfile
#
printf MAP\n  ${MAPFILE}.map
printf   NAME %s\n $MAPFILE  ${MAPFILE}.map
printf   SIZE 1000 1000\n  ${MAPFILE}.map
printf   UNITS dd\n  ${MAPFILE}.map
printf   EXTENT %s %s %s %s\n ${minx} ${miny} ${maxx} ${maxy}  
${MAPFILE}.map
….
…and the rest of the mapfile in the same manner.

/Lars S.


From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of alok mathur
Sent: den 10 mars 2015 12:15
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Best Practice

Hi ,

Could any one suggest me to how to create .map file from KML file. Are any 
tools available.
My requirement is to take KML file as input create .map file corresponding to 
that KML and provide changes on map so that it reflects on the fly.


--

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

[mapserver-users] layer handling in Mapserver WMS clients

2015-02-10 Thread Schylberg Lars
Hi,

I have a follow up question on my question yesterday.  I would like to have the 
layers in the main called mapfile to be set layers in the client WMS calls.
The WMS client documentation says, http://mapserver.org/ogc/wms_client.html :

wms_name metadata - comma-separated list of layers to be fetched from the 
remote WMS server. This value is used to set the LAYERS and QUERY_LAYERS WMS 
URL parameters

When I call the MAP_MAIN I would like to call it like this:

http://localhost/cgi-bin/mapserv?map=/var/www/html/map2/MAP_MAIN.map
SERVICE=WMSREQUEST=GetmapVERSION=1.1.1
LAYERS=base,marks,textsrs=EPSG:4326BBOX=9.624750,52.3,30.33,66.50
FORMAT=application/openlayersWIDTH=2000HEIGHT=1100

or  LAYERS=base,text   or  LAYERS=base

Is the mechanism similar to the srs handling?
How do I expose the layers in the wms clients map files?  Right now I use GROUP 
to define the layers and that works when I call it directly.  Or is it so that 
I have to expose the layers with
WMS_LAYER_GROUP in the wms-server mapfiles that are called as clients? I 
haven't been successful with that! I have several clients with the same layer 
structure and one with just default.

/Lars


MAP
  NAME MAP_MAIN
  SIZE 1000 1000
  CONFIG PROJ_LIB './'
  UNITS dd
  EXTENT 9.624750 52.3 30.33 66.50

 PROJECTION
 'init=epsg:4326'
  END

  IMAGETYPE png
  FONTSET './fonts/fontset.lst'
  SYMBOLSET ./symbols/symbols.sym
  OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGB
  END

  SHAPEPATH ../data/shape

  WEB
IMAGEPATH '/tmp/'
IMAGEURL '/tmp/'

METADATA
  ows_enable_request   *
  'wms_title'   'MAP_MAIN'
  'wms_srs'  'EPSG:32633 EPSG:3006 EPSG:3857 EPSG:4326'
  labelcache_map_edge_buffer -10
END
  END

###  Layer 0 as WMS request

   LAYER
 NAME WMS-layer-0
 OFFSITE 200 0 0
 TYPE RASTER
 CONNECTIONTYPE WMS
 CONNECTION http://localhost/cgi-bin/mapserv?map=/var/www/html/map0.map;
 METADATA
  'wms_srs''EPSG:32633 EPSG:3006 EPSG:3857 EPSG:4326'
   wms_name  default
   wms_server_version1.1.1
   wms_formatimage/png
   wms_exceptions_format application/vnd.ogc.se_inimage
 END
   END #layer

###  Layer 1 as WMS request

   LAYER
 NAME WMS-layer-1
 OFFSITE 200 0 0
 TYPE RASTER
 CONNECTIONTYPE WMS
 CONNECTION http://localhost/cgi-bin/mapserv?map=/var/www/html/map1.map;
 METADATA
  'wms_srs'   'EPSG:32633 EPSG:3006 EPSG:3857 EPSG:4326'
   wms_name   base,marks,text#???
   wms_server_version1.1.1
   wms_formatimage/png
   wms_exceptions_format application/vnd.ogc.se_inimage
 END
   END #layer

END # Map


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

Re: [mapserver-users] [EXTERNAL] WMS SRS as variable

2015-02-09 Thread Schylberg Lars
Mike,

Thanks for your reply, but it is when I call the wms services as a client I get 
the errors already in the validation.  I would like to do something like this:
But I guess I am doing something that is not meant to be this way.

MAP
  NAME MAP_MAIN
  SIZE 1000 1000
  CONFIG PROJ_LIB './'
  UNITS dd
  EXTENT 9.624750 52.3 30.33 66.50

 PROJECTION
 'init=epsg:4326'
  END

  IMAGETYPE png
  FONTSET './fonts/fontset.lst'
  SYMBOLSET ./symbols/symbols.sym
  OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGB
  END

  SHAPEPATH ../data/shape


  WEB
IMAGEPATH '/tmp/'
IMAGEURL '/tmp/'

METADATA
  ows_enable_request   *
  'wms_title'   'MAP_MAIN'
  'wms_srs'  'EPSG:32633 EPSG:3006 EPSG:900913 EPSG:4326'
  labelcache_map_edge_buffer -10
END
  END

VALIDATION
   srs ^[0-9]{4,5)$
END

###  Layer 0 as WMS request

   LAYER
 NAME WMS-layer-0
 OFFSITE 200 0 0
 TYPE RASTER
 CONNECTIONTYPE WMS
 CONNECTION http://localhost/cgi-bin/mapserv?map=/var/www/html/map0.map;
 METADATA
   wms_srs   'EPSG:''%srs%'
   wms_name  map0
   wms_server_version1.1.1
   wms_formatimage/png
   wms_exceptions_format application/vnd.ogc.se_inimage
 END
   END #layer

###  Layer 1 as WMS request

   LAYER
 NAME WMS-layer-1
 OFFSITE 200 0 0
 TYPE RASTER
 CONNECTIONTYPE WMS
 CONNECTION http://localhost/cgi-bin/mapserv?map=/var/www/html/map1.map;
 METADATA
   wms_srs   'EPSG:''%srs%'
   wms_name  map1
   wms_server_version1.1.1
   wms_formatimage/png
   wms_exceptions_format application/vnd.ogc.se_inimage
 END
   END #layer

END # Map

From: Smith, Michael ERDC-RDE-CRREL-NH [mailto:michael.sm...@erdc.dren.mil]
Sent: den 6 februari 2015 16:31
To: Schylberg Lars; mapserver-users@lists.osgeo.org
Subject: Re: [EXTERNAL] [mapserver-users] WMS SRS as variable

Lars,

A WMS map can support multiple SRS's. Just list all the ones you want in the 
METADATA block. Look at http://mapserver.org/ogc/wms_server.html and 
specifically the Map PROJECTION and wms_srs metadata. From the example, you can 
see that 2 SRS's are supported.


 METADATA

wms_title   WMS Demo Server

wms_onlineresource  http://my.host.com/cgi-bin/mapserv?map=wms.map;

wms_srs EPSG:4269 EPSG:4326

  END
Just keep adding to the list to support more projections.

Mike


From: Schylberg Lars 
lars.schylb...@saabgroup.commailto:lars.schylb...@saabgroup.com
Date: Friday, February 6, 2015 at 10:05 AM
To: mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org 
mapserver-users@lists.osgeo.orgmailto:mapserver-users@lists.osgeo.org
Subject: [EXTERNAL] [mapserver-users] WMS SRS as variable
Resent-From: Michael Smith 
michael.sm...@usace.army.milmailto:michael.sm...@usace.army.mil

Hello,

I wonder if there is a way to set SRS as a variable in a map file.

I have one map file that uses several other WMS clients that also are mapfiles.
I would like to use the SRS as variable to make the WMS service more flexible.

I have tried to do VALIDATION on SRS variable, but that only gives errors.

Thanks /Lars S.

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

Re: [mapserver-users] [EXTERNAL] WMS SRS as variable

2015-02-09 Thread Schylberg Lars
Thanks Jukka,

It works!  I had missed the detail that you could have space separated list in 
wms_srs specification.
Now I have to see if I can the layers to work also in the cascading WMS 
services.

You are right about the google proj. I should change to 3857 even if I full 
control right now.

/Lars


From: Rahkonen Jukka (MML) [mailto:jukka.rahko...@maanmittauslaitos.fi]
Sent: den 9 februari 2015 12:03
To: Schylberg Lars; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] [EXTERNAL] WMS SRS as variable

Hi,

Ok, I start to understand little by little. It is not about making your 
Mapserver to support several SRS in output, it is about making your Mapserver 
to send GetMaps to cascaded remote WMS services by using the most reasonable 
SRS in the request, that is, usually the same SRS as used for output so that 
Mapserver does not need to do interim warping.

I suggest to include enough from the mapfile for making the questions and 
answers understandable. Let's take this sample from 
http://mapserver.org/ogc/wms_client.html

LAYER
  NAME country_bounds
  TYPE RASTER
  STATUS ON
  CONNECTION http://demo.mapserver.org/cgi-bin/wms?;
  CONNECTIONTYPE WMS
  METADATA
wms_srs EPSG:4326 #=== THIS CAN BE A SPACE SEPARATED 
LIST
wms_namecountry_bounds
wms_server_version  1.1.1
wms_format  image/gif
  END
END

You would like to use variable substitution in wms_srs EPSG:%srs%. That is 
not possible because there are only a few places where substitutions can be 
used. See http://mapserver.org/cgi/runsub.html and Parameters supported.
However, if you want to support output in 'EPSG:32633 EPSG:3006 EPSG:900913 
EPSG:4326' you can use the same list in the wms_srs metadata item of the 
cascaded WMS layer. Then if you want output in EPSG:32633 Mapserver will use 
the same SRS in GetMaps that it is creating and I suppose that it is your goal.

Be aware with EPSG:900913, recent Mapservers do not support it out-of-the-box 
but you must edit the epsg projection file manually. It would better to use  
EPSG:3857 instead but then the remote WMS should also understand the meaning of 
EPSG:3857 .

If request rewriting is absolutely needed, like you want to send out EPSG:3857 
but remote WMS understands only EPSG:900913 or you need to do some other 
tailored mapping between the codes, then I suppose you should  use some 
miraculous mapscript for rewriting the mapfile.

-Jukka Rahkonen-


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

[mapserver-users] WMS SRS as variable

2015-02-06 Thread Schylberg Lars
Hello,

I wonder if there is a way to set SRS as a variable in a map file.

I have one map file that uses several other WMS clients that also are mapfiles.
I would like to use the SRS as variable to make the WMS service more flexible.

I have tried to do VALIDATION on SRS variable, but that only gives errors.

Thanks /Lars S.

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

[mapserver-users] anchor label positions

2013-09-12 Thread Schylberg Lars
Hello,
I have read the following discussion below but have not found out if anything 
has happened since then.
http://lists.osgeo.org/pipermail/mapserver-users/2008-December/059123.html
http://lists.osgeo.org/pipermail/mapserver-users/2010-November/067312.html
I have shape files with anchor  point positions:
7 8 9
4 5 6
1 2 3
That corresponds:
ul uc ur
cl cc cr
ll lc lr
I wrote my mapfile as shown below.  Is there a more  simple and shorter way to 
express this today?
TJUST variable is the POSITION expressed as a integer between 1 and 9 in my 
shape files
If there is no way to do this, could I remap the shape file with ogr2ogr to add 
an extra column in the table with mapserver positions?
/Lars
LAYER
NAME 'LAKESNAMES'
  TYPE POINT
GROUP 'default'
PROJECTION
'init=epsg:32633'
END
STATUS ON
SIZEUNITS PIXELS
DATA 'sve1milj_32633/tx_riks'
CLASSITEM KKOD
  CLASS
   NAME TextLake5
   EXPRESSION /87|86/
   LABEL
 EXPRESSION ([TJUST] = 7)
 SIZE 8
 FONT 'sc'
 TYPE truetype
 POSITION ul
ANGLE [TRIKT]
 COLOR 0 0 0
TEXT '[TEXT]'
   END
   LABEL
 EXPRESSION ([TJUST] = 8)
 SIZE 8
 FONT 'sc'
 TYPE truetype
 POSITION uc
ANGLE [TRIKT]
 COLOR 0 0 0
TEXT [TEXT]
   END
   LABEL
 EXPRESSION ([TJUST] = 9)
 SIZE 8
 FONT 'sc'
 TYPE truetype
 POSITION ur
ANGLE [TRIKT]
 COLOR 0 0 0
TEXT [TEXT]
   END
   LABEL
 EXPRESSION ([TJUST] = 4)
 SIZE 8
 FONT 'sc'
 TYPE truetype
 POSITION cl
ANGLE [TRIKT]
 COLOR 0 0 0
TEXT [TEXT]
   END
   LABEL
 EXPRESSION ([TJUST] = 5)
 SIZE 8
 FONT 'sc'
 TYPE truetype
 POSITION cc
ANGLE [TRIKT]
 COLOR 0 0 0
TEXT [TEXT]
   END
   LABEL
 EXPRESSION ([TJUST] = 6)

... and 5 more expressions in the same way.






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