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] Is there a way to convert a QGIS layout into a .map file?

2015-03-18 Thread Rahkonen Jukka (MML)
Hi,

There is this plugin http://plugins.qgis.org/plugins/rt_mapserver_exporter/
and old documentation 
http://docs.qgis.org/1.8/en/docs/user_manual/plugins/plugins_mapserver_export.html

Unfortunately the plugin makes mapfiles which were usable as-is with Mapserver 
5.x but not since that. It also creates mapfiles which I do not like a lot 
because it is lazy with PROJECTION blocks etc. but that is at least partly 
matter of taste. But if you know how to write valid mapfiles for Mapserver v. 
6.x and above then that plugin does make usable templates which can save time. 
It would be nice to get that plugin up-to-date.

Other alternatives which do not help with QGIS styles but are worth having a 
look:  http://scribeui.org/ and  http://gisinternals.com/mapmanager.html 

-Jukka Rahkonen-



Michael Kleih wrote: 

 Hello all,
 I am using Mapserver since nearly 20 years and like it a lot.
 QGIS is getting better and better and it would be nice to layout a map in 
 QGIS and then convert it to a .map-file to be used with Mapserver. 
 Does anybody know if this is possible?

 Thanks to all,
 Michael
___
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] How use a spatialite as tileindex for raster

2015-03-18 Thread Rahkonen Jukka (MML)
Hi,

I use a batch file which creates own shapefile tileindex for each orthophoto 
directory because I need separate shapefiles for another purpose, snippet here:
gdaltindex -t_srs epsg:3067 -write_absolute_path -src_srs_name src_srs %1.shp 
/%1/*.TIF

 and another batch file that combines them into Spatialite to be used with 
Mapserver:

ogr2ogr -f SQLite -dsco spatialite=yes -dsco init_with_epsg=yes -a_srs 
epsg:3067 ortho.sqlite dir_0.shp -nln orthos
ogr2ogr -update -append -a_srs epsg:3067 ortho.sqlite dir_1.shp -nln orthos
ogr2ogr -update -append -a_srs epsg:3067 ortho.sqlite dir_2.shp -nln orthos
...

Spatialite suits me perfectly because I can add some metadata into it and then 
make layers by attributes like acquisition year:
LAYER
NAME orthos_2011
CONNECTIONTYPE OGR
CONNECTION /ortho.sqlite
DATA select * from orthos where year=2011
...

-Jukka Rahkonen-

Schylberg Lars wrote:

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


Re: [mapserver-users] Is there a way to convert a QGIS layout into a .map file?

2015-03-18 Thread Jörg Thomsen
Am 18.03.2015 um 13:20 schrieb Jeff McKenna:
 Hi Michael,
 
 I am with you on how important QGIS is for our workflow.
 
 I am aware of a MapServer plugin that is designed for QGIS 2.x, however
 I use the standalone QGIS always, so I have yet to be able to test it
 (it is however available with OSGeo4W apparently).  Give it a try:
 https://plugins.qgis.org/plugins/rt_mapserver_exporter/

it works for file-datasources and there is a wrong definition for
postgis-connections ('USING UNIQUE epsg' instead of 'USING SRID epsg').
But you should have to look at the mapfile in any case.

For finding and using the extension in qgis you have enable the
experimantal plugins.

Jörg

 
 The code for it lives on GitHub
 (https://github.com/faunalia/rt_mapserver_exporter), so maybe some
 passionate MapServer devs can contribute.
 
 -jeff
 

___
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] Is there a way to convert a QGIS layout into a .map file?

2015-03-18 Thread Jeff McKenna

Hi Michael,

I am with you on how important QGIS is for our workflow.

I am aware of a MapServer plugin that is designed for QGIS 2.x, however 
I use the standalone QGIS always, so I have yet to be able to test it 
(it is however available with OSGeo4W apparently).  Give it a try: 
https://plugins.qgis.org/plugins/rt_mapserver_exporter/


The code for it lives on GitHub 
(https://github.com/faunalia/rt_mapserver_exporter), so maybe some 
passionate MapServer devs can contribute.


-jeff

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



On 2015-03-18 4:47 AM, Michael Kleih wrote:


Hello all,
I am using Mapserver since nearly 20 years and like it a lot.
QGIS is getting better and better and it would be nice to layout a map
in QGIS and then convert it to a .map-file to be used with Mapserver.
Does anybody know if this is possible?

Thanks to all,
Michael



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


Re: [mapserver-users] Best integration with dynamic map information

2015-03-18 Thread Ahmed Aboulenein
Thank you so much, Mark! That's a very convenient/effiecient architecture
for us since our engine is already in AWS. Thanks again for your help!

Best regards,
Ahmed

On Tue, Mar 17, 2015 at 11:07 PM, Mark Korver mwkor...@gmail.com wrote:

 In order to serve a lot of requests you generally need to cache. That
 would be true of any query against a db, or against a shapefile. The point
 is, you don't want to go to db or to disk.
 In order make this happen for maps the usual pattern is to serve tiles. If
 your data gets updated every 5 minutes, and in your case it is the whole
 thing, not just some part. Then you need to make sure no map tile lives
 longer than 5 minutes, actually less than 5 minutes.
 One simple way to solve for this is to use a Content Delivery Network.
 something like this:

 http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html
 You would point the CDN at your TMS or WMTS server. which would never have
 to make the same tile more than once every few minutes.
 Another related point would be to put the tile server behind a load
 balancer, then point the CDN at the load balancer.
 on Amazon that would be an ELB.
 -Mark

 On Tue, Mar 17, 2015 at 1:41 PM, Lime, Steve D (MNIT) 
 steve.l...@state.mn.us wrote:

  MapCache would be a **much** better option than using MapServer in tile
 mode. You still need something to render tiles (e.g. MapServer) but
 MapCache manages the tiles and is the interface between your client
 application and the tiled data. The brute force method would be replace the
 data and then blow away the cache and let MapCache (and MapServer) rebuild
 as users request tiles. The first request will result in MapCache making a
 call to MapServer to generate the tile/metatile, but subsequent requests
 for tiles will use the cached tiles.



 Others on the list may well have more experience and better ideas.



 Steve



 *From:* Ahmed Aboulenein [mailto:aboulenein.ah...@gmail.com]
 *Sent:* Tuesday, March 17, 2015 2:54 PM
 *To:* Lime, Steve D (MNIT)
 *Cc:* mapserver-users@lists.osgeo.org
 *Subject:* Re: [mapserver-users] Best integration with dynamic map
 information



 Hi Steve,

 Thank you so much for the informative reply, much appreciated!

 It's actually a new dataset copy every 5 minutes, it seems like replacing
 a shape file would be most efficient.

 We are not using MapCache, do you think it would be a good option for our
 use case with this frequent updates?

 Thanks again, Steve!

 Best regards,

 Ahmed



 On Tue, Mar 17, 2015 at 8:03 PM, Lime, Steve D (MNIT) 
 steve.l...@state.mn.us wrote:

 I’ll let others weigh in on throughput. Seems like that should be a
 matter of resources and how much hardware you can throw at the problem. Are
 you using MapCache to serve tiles? MapServer itself is good for rendering
 tiles or more likely, metatiles.



 On thread safety MapServer itself isn’t doing any file locking.
 Presumably the OS or database is handling contention issues. I’d think the
 right way to go for data storage depends on your update process itself. If
 you want to incrementally tweak lines as new information becomes available
 then a database backend seems more reasonable – I’d think you could detect
 change easier and perhaps only retile very specific areas as a result. If
 instead you’re getting a new copy of your entire dataset every 5 minutes
 then perhaps a shapefile would work best – just replace the file and
 trigger retiling.



 Steve



 *From:* mapserver-users-boun...@lists.osgeo.org [mailto:
 mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Ahmed Aboulenein
 *Sent:* Tuesday, March 17, 2015 9:19 AM
 *To:* mapserver-users@lists.osgeo.org
 *Subject:* [mapserver-users] Best integration with dynamic map
 information



 Hi ALL,

 We serve traffic lines that gets updated every 5 minutes from our feeds.
 We would like to use Map Server to generate transparent tiles showing
 colored polylines of the traffic.

 I am newbie to Map Server, I got the server and workshop running and also
 I think I have some good understanding of the map file and layers concept.
 I have a question about integrating our traffic information as a data
 source to the MapServer.

 Important aspects for us:

 1. Performance: since we are updating large areas every 5 minutes. We
 will need throughput like 10K images per second. Does this sound okay?

 2. Threads safety: my concern what happens if while updating the source,
 the MapServer is actually rendering an image from old data. Any locks?

 I understand our options are:

 1. Data files: such as shape files or KML files.

 2. Database: PostGIS for example.

 3. Service that pulls data: WMS server - I didn't dig much here.

 Thanks in advance for your help, some pointers or information to go
 further.

 Best regards,

 Ahmed



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




Re: [mapserver-users] Is there a way to convert a QGIS layout into a .map file?

2015-03-18 Thread Jeff McKenna
I wonder the same, especially seeing that plugin code living on GitHub. 
 Think of how QGIS has become the frontend for GRASS, it could(should!) 
be the frontend for MapServer.


There is definitely huge momentum in the QGIS community (I've even been 
asked to attend their first QGIS conference, and followup dev meeting, 
in May).  I can imagine/dream of a joint MapServer/QGIS code sprint, 
totally funded (as a few of the OpenLayers3 sprints were) happening 
someday. Would be amazing.


-jeff




On 2015-03-18 2:50 PM, Lime, Steve D (MNIT) wrote:

I've wondered if we could/should pull the plug-in into the MapServer project 
itself.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Rahkonen Jukka 
(MML)
Sent: Wednesday, March 18, 2015 3:16 AM
To: Michael Kleih; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Is there a way to convert a QGIS layout into a 
.map file?

Hi,

There is this plugin http://plugins.qgis.org/plugins/rt_mapserver_exporter/
and old documentation 
http://docs.qgis.org/1.8/en/docs/user_manual/plugins/plugins_mapserver_export.html

Unfortunately the plugin makes mapfiles which were usable as-is with Mapserver 
5.x but not since that. It also creates mapfiles which I do not like a lot 
because it is lazy with PROJECTION blocks etc. but that is at least partly 
matter of taste. But if you know how to write valid mapfiles for Mapserver v. 
6.x and above then that plugin does make usable templates which can save time. 
It would be nice to get that plugin up-to-date.

Other alternatives which do not help with QGIS styles but are worth having a 
look:  http://scribeui.org/ and  http://gisinternals.com/mapmanager.html

-Jukka Rahkonen-



Michael Kleih wrote:


Hello all,
I am using Mapserver since nearly 20 years and like it a lot.
QGIS is getting better and better and it would be nice to layout a map in QGIS and then 
convert it to a .map-file to be used with Mapserver.
Does anybody know if this is possible?



Thanks to all,
Michael

___
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




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


Re: [mapserver-users] Is there a way to convert a QGIS layout into a .map file?

2015-03-18 Thread Lime, Steve D (MNIT)
I've wondered if we could/should pull the plug-in into the MapServer project 
itself.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Rahkonen Jukka 
(MML)
Sent: Wednesday, March 18, 2015 3:16 AM
To: Michael Kleih; mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Is there a way to convert a QGIS layout into a 
.map file?

Hi,

There is this plugin http://plugins.qgis.org/plugins/rt_mapserver_exporter/
and old documentation 
http://docs.qgis.org/1.8/en/docs/user_manual/plugins/plugins_mapserver_export.html

Unfortunately the plugin makes mapfiles which were usable as-is with Mapserver 
5.x but not since that. It also creates mapfiles which I do not like a lot 
because it is lazy with PROJECTION blocks etc. but that is at least partly 
matter of taste. But if you know how to write valid mapfiles for Mapserver v. 
6.x and above then that plugin does make usable templates which can save time. 
It would be nice to get that plugin up-to-date.

Other alternatives which do not help with QGIS styles but are worth having a 
look:  http://scribeui.org/ and  http://gisinternals.com/mapmanager.html 

-Jukka Rahkonen-



Michael Kleih wrote: 

 Hello all,
 I am using Mapserver since nearly 20 years and like it a lot.
 QGIS is getting better and better and it would be nice to layout a map in 
 QGIS and then convert it to a .map-file to be used with Mapserver. 
 Does anybody know if this is possible?

 Thanks to all,
 Michael
___
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