Re: [mapserver-users] Getting centroid coords

2013-02-05 Thread Thomasch

Bistrais, Bob wrote:


$centroid = $oShape-getCentroid();

from http://mapserver.org/mapscript/php/index.html#shapeobj :
pointObj getCentroid()
Returns a point object representing the centroid of the shape. Only 
available if php/mapscript is built with GEOS library.


Here you get an point object


print Centroid=. $centroid(x).,. $centroid(y);


try print Centroid=.$centroid-x;

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


Re: [mapserver-users] Map background color using OL/WMS

2010-05-25 Thread Thomasch

Am 25.05.2010 20:21, schrieb Paul james:

Thanks Jeff...
But do you know how change map background ? Using Mapscript IMAGECOLOR works
fine...
With CGI/WMS/OL i cant get that to work...

Paul
Just a guess - I think you have to change the backround of your Map in 
the Client Side. If you don't have only one Layer, your wms Layers 
should be transparent. And as wms serves only Layers, there is no way to 
change the backgroundcolor on Server Side.


But maybe I'm wrong


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


Re: [mapserver-users] Map background color using OL/WMS

2010-05-25 Thread Thomasch

Am 25.05.2010 21:36, schrieb Paul james:

Thanks Thomas...
But how can I change the backround in Client Side?


Just find the Id of your DIV containing yout map and change the 
backgound Color. Maybe there is in the Styles Secion someting like


style

#map {
width: 800px;
height: 500px;
float: left;
border: 1px solid #ccc;
}
 [...]
/style

Just add background-color:#FF like

style

#map {
width: 800px;
height: 500px;
float: left;
border: 1px solid #ccc;
background-color:#FF
}
 [...]
/style

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


Re: [mapserver-users] wms with gernerated Layers

2010-03-18 Thread Thomasch

Hi,
at first thanks for your hint - I'm now trying to write a simple wrapper 
in PHP Mapscript But the follwoing simple Code doesn't work.
Unfortunately the example in 
http://www.mapserver.org/ogc/wms_server.html is in Python.


?php
$myMap=ms_newMapObj('/home/thomas/public_html/wms/maps/wms.map');
$req = ms_newOwsrequestObj();
$req-loadParams();
$myMap-owsdispatch($req);

?

The plain Call of GetCapabilities like 
http://myserver/cgi-bin/mapserv?map=/home/thomas/public_html/wms/maps/wms.mapSERVICE=WMSVERSION=1.1.1REQUEST=GetCapabilities 
works fine.



Thomasch

Am 17.03.2010 03:01, Jeff McKenna wrote:

Thomasch wrote:

Hi,
I've got an map which contains some generated Layers using PHP
Mapscript. How do I serve these Layers as wms?

I read http://mapserver.org/ogc/mapscript.html but I don't really
understand at which place i could modify the map itself.



Hi Thomasch,

For instructions on how to serve your mapfile through WMS, please see
the WMS Server document: http://www.mapserver.org/ogc/wms_server.html

The example in that document is probably most helpful:
http://www.mapserver.org/ogc/wms_server.html#sample-wms-server-mapfile

I hope this gets you going in the right direction.

-jeff





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


Re: [mapserver-users] OSM2pgsql, latlong, OpenStreetMap data, uDig = weird projection

2010-03-15 Thread Thomasch

Hi,
there is an HowTo: http://trac.osgeo.org/mapserver/wiki/RenderingOsmData

In your Mapfile, you have to state the Projection like the following:
Map
  PROJECTION
init=epsg:4326
  END
[...]
LAYER
METADATA
WMS_TITLE Parks
END
CLASSITEM leisure
CONNECTION user=xxx password=xxx dbname=xxx host=localhost port=5432
CONNECTIONTYPE POSTGIS
DATA way FROM planet_osm_polygon using unique gid using srid=900913 
NAME OSM_Parks
STATUS ON
TOLERANCE 0
TYPE POLYGON
LabelItem name
CLASS
NAME Parks
EXPRESSION park
STYLE
COLOR 89 150 89
END
LABEL
   COLOR  0 0 0
   FONT vera_sans
   TYPE truetype
   SIZE 8
   POSITION AUTO
   MINDISTANCE 0
   PARTIALS FALSE
   OUTLINECOLOR 255 255 255
END
END
PROJECTION
  init=epsg:900913
END
 END
END

Maybe that helps.


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


[mapserver-users] wms with gernerated Layers

2010-03-15 Thread Thomasch

Hi,
I've got an map which contains some generated Layers using PHP 
Mapscript. How do I serve these Layers as wms?


I read http://mapserver.org/ogc/mapscript.html but I don't really 
understand at which place i could modify the map itself.



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


Re: [mapserver-users] Re: OSM2pgsql, latlong, OpenStreetMap data, uDig = weird projection

2010-03-15 Thread Thomasch

Hi Mulone,
I'm not familiar with OpenLayers - in a quick search I found 
http://trac.openlayers.org/wiki/SphericalMercator


If the Map itself (without using wms) is displayed correctly, did you 
try another WMS Client?


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


Re: [mapserver-users] Label on Query Result

2009-08-25 Thread Thomasch

Hi,
the combination MINDISTANCE 0 an POSITION AUTO works as is should. Every 
other settings cause no or two Labels.


Anyway, thank you for the workaraound.

Thomasch

Steve Lime wrote:
Depending on the TYPE of querymap the layer can have features 
drawn twice. Those features use the same label definition though.

Try setting a MINDISTANCE for the layer in question. I would think
a relatively modest value would remove the duplicates.

Steve


Thomasch thomas...@gmx.de 08/23/09 3:34 PM 

Hi,
in the GMAP Demo the Query Results (e.g. for the Layer Cities) are 
labeled twice. If I change the Label positon from AUTO to someting 
other, the label of my result disappaers.


Is there a way to label only the query results?


Thanks


Thomasch
___
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] Mapscript Strange behaviour of drawQuery

2009-08-23 Thread Thomasch

Hi,
I'm using Mapserver 5.2.1 on WinXP.
If I try to draw a query using drawQuery() the scale of my map is 
changed - even if the qurery returns no result. If I don't draw the 
query, everyting is fine.


Please see my code in Attachement.

Is there a workaraund?


Thank you


Thomasch
MAP
  EXTENT 12.4321 51.1277 12.439334 51.168119
  
  FONTSET fonts/fonts.list
  TEMPLATEPATTERN test
  IMAGECOLOR 215 215 215
  IMAGETYPE png
  SHAPEPATH C:/Programme/ms4w/apps/Test/data
  SIZE 400 400
  STATUS ON
  UNITS DD
  CONFIG MS_ERRORFILE C:/Programme/ms4w/tmp/ms_error.txt
  NAME Test4

  OUTPUTFORMAT
NAME png
MIMETYPE image/png
DRIVER GD/PNG
EXTENSION png
IMAGEMODE PC256
TRANSPARENT FALSE
  END

  PROJECTION
init=epsg:4326
  END

  QUERYMAP
COLOR 255 255 0
SIZE 260 210
STATUS ON
STYLE HILITE
  END

  WEB
FOOTER footer.html
HEADER header.html
IMAGEPATH C:/Programme/ms4w/tmp/ms_tmp/
IMAGEURL /ms_tmp/
LOG C:/Programme/ms4w/log/mslog/log.txt
QUERYFORMAT text/html
LEGENDFORMAT text/html
BROWSEFORMAT text/html
TEMPLATE basic.html
  END

  LAYER
CLASSITEM orte
DATA orte
DUMP TRUE
FOOTER TP_footer.html
HEADER TP_header.html
LABELITEM orte
METADATA
  qstring_validation_pattern  .
END
NAME orte
STATUS ON
TOLERANCE 0
TYPE POLYGON
UNITS METERS
CLASS
  NAME orte
  LABEL
SIZE MEDIUM
TYPE BITMAP
BUFFER 2
COLOR 0 0 0
FORCE FALSE
MINDISTANCE -1
MINFEATURESIZE -1
OFFSET 0 0
PARTIALS TRUE
POSITION CC
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
  END
  STYLE
ANGLE 360
COLOR 232 252 232
OPACITY 100
OUTLINECOLOR 32 32 32
SYMBOL 0
  END
  TEMPLATE TP.html
END
  END

END
Title: Map 3
setextent($extent_to_set[0],$extent_to_set[1],
   			$extent_to_set[2],$extent_to_set[3]);
  
   	$my_extent = ms_newrectObj();

   	$my_extent->setextent($extent_to_set[0],$extent_to_set[1],
 $extent_to_set[2],$extent_to_set[3]);
  
	$dfKeyMapXMin = $map->extent->minx;
$dfKeyMapYMin = $map->extent->miny;
$dfKeyMapXMax = $map->extent->maxx;
$dfKeyMapYMax = $map->extent->maxy;

	$nClickPixX = doubleval($HTTP_POST_VARS["mapa_x"]);
$nClickPixY = doubleval($HTTP_POST_VARS["mapa_y"]);

$dfWidthPix = 400;
$dfHeightPix = 400;

$nClickGeoX = GMapPix2Geo($nClickPixX, 0, $dfWidthPix, $dfKeyMapXMin,$dfKeyMapXMax, 0);
$nClickGeoY = GMapPix2Geo($nClickPixY, 0, $dfHeightPix, $dfKeyMapYMin,$dfKeyMapYMax, 1);

	$my_point3 = ms_newpointObj();
$my_point3->setXY($nClickGeoX,$nClickGeoY);

	foreach ( ($map->getAllLayerNames()) as $idx => $Name){
		$Layer=$map->getLayerByName($Name);
		$Layer->open();
	}

	$ret = $map->queryByPoint($my_point3,MS_MULTIPLE, -1);
	if ($ret==mapserv.MS_SUCCESS){
		foreach ( ($map->getAllLayerNames()) as $idx => $Name){
			$Layer=$map->getLayerByName($Name);
			$Layer->open();
			$res = $Layer->getResult(0);
			if ($res>0){
$shape = $Layer->getFeature($res->shapeindex,-1);

echo'';
print_r ($shape->values);
echo'';	
			}
		}
	}
}

$image=$map->draw();
$image_url=$image->saveWebImage();

//		 $image2=$map->drawQuery();

//		 $image_url2=$image2->saveWebImage();


 $extent_to_html = $map->extent->minx." ".$map->extent->miny." "
  .$map->extent->maxx." ".$map->extent->maxy;

 ?>
 
 
 
 
  >

  ">
  ">
  ">
 
 
 
 

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


[mapserver-users] Label on Query Result

2009-08-23 Thread Thomasch

Hi,
in the GMAP Demo the Query Results (e.g. for the Layer Cities) are 
labeled twice. If I change the Label positon from AUTO to someting 
other, the label of my result disappaers.


Is there a way to label only the query results?


Thanks


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


[mapserver-users] Can't get any Results from a simple query

2009-08-20 Thread Thomasch

Hi,
I'm quite new in Mapserver, so sorry for this simple question:

I use the Itasca Demo with my own little map, containing just a few 
layers. The layers are displayed and labeld, so the connection is ok.

But, if I try to query an Object, i always get:
msQueryByPoint(): Search returned no results. No matching record(s) found

I think I should get the geomety data at least?

Here is the Layer part of my map file:

Code:
   LAYER
NAME orte
DATA orte
STATUS   ON
TYPE POLYGON
LABELITEM orte
CLASSITEM orte

METADATA
qstring_validation_pattern '.'
END
TOLERANCE 300
CLASS
  NAME   'orte'
  TEMPLATE TP.html
  STYLE
   COLOR232 252 232
   OUTLINECOLOR 32 32 32
  END
  LABEL
COLOR 0 0 0
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE BITMAP
SIZE MEDIUM
POSITION CC
PARTIALS TRUE
BUFFER 2
  END
END
  END


Thanks in advance



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