Re: [mapserver-users] Customized layer for Mapserver/Kamap

2008-05-15 Thread Emilio Ponce
Thank you very much Florin!

This code is very useful, is not exactly what I needs but gives me
orientation about how to implement my mapfile.



2008/5/14 Florin A. [EMAIL PROTECTED]:

 Hi,

 In your mapfile you define the layers and the colors. See example below.

 If you have an SRID (projection) for the layer use it.  You can see
 what it is by  selecting this sql  in pgadmin:  select srid(the_geom)
 from cities)   .  Use the number you get here in the mapserver layer
 definition and in the projection definition as well.  If you loaded
 the cities with shp2pgsql then you should automatically have a gid
 field on the cities table.   And  your cities table should have a
 population field the type of which  should be some kind of number.


 LAYER
METADATA
wms_title  Cities layer
END
NAME cities
TRANSPARENCY 100
CONNECTIONTYPE postgis
CONNECTION host=??? user=???  dbname=???  password='???'
DATA the_geom from cities using srid=???  USING UNIQUE gid
TYPE POLYGON

   CLASS
NAME Small cities
EXPRESSION ( [population] 5)
COLOR 0 255 0
END

CLASS
NAME Medium cities
EXPRESSION ([population] 5 AND [population] 150 )
COLOR 255 255 0
END

CLASS
NAME Big cities
EXPRESSION ([population]  150 )
COLOR 255 0 0
END


 END

 Hope this helps,
 Florin




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


Re: [mapserver-users] Customized layer for Mapserver/Kamap

2008-05-14 Thread Florin A.
Hi,

In your mapfile you define the layers and the colors. See example below.

If you have an SRID (projection) for the layer use it.  You can see
what it is by  selecting this sql  in pgadmin:  select srid(the_geom)
from cities)   .  Use the number you get here in the mapserver layer
definition and in the projection definition as well.  If you loaded
the cities with shp2pgsql then you should automatically have a gid
field on the cities table.   And  your cities table should have a
population field the type of which  should be some kind of number.


LAYER
METADATA
wms_title  Cities layer
END
NAME cities
TRANSPARENCY 100
CONNECTIONTYPE postgis
CONNECTION host=??? user=???  dbname=???  password='???'
DATA the_geom from cities using srid=???  USING UNIQUE gid
TYPE POLYGON

   CLASS
NAME Small cities
EXPRESSION ( [population] 5)
COLOR 0 255 0
END

CLASS
NAME Medium cities
EXPRESSION ([population] 5 AND [population] 150 )
COLOR 255 255 0
END

CLASS
NAME Big cities
EXPRESSION ([population]  150 )
COLOR 255 0 0
END


END

Hope this helps,
Florin
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Customized layer for Mapserver/Kamap

2008-05-13 Thread Emilio Ponce
Hi Florin,

I have a layer with polygons representing cities (stored in PostGIS), and my
idea is to set the colour of these polygons in function of variables like
'population', as I show on my last e-mail.
I'm going to use the same colour for all the polygons, but the colour of the
polygon Barcelona will be lighter than the colour of the polygon Madrid,
because Madrid has more population.

The problem is basically how can I relate the numeric variables like
population with the geometry of every city? If I can do this I supose that
setting the colour will be not a big problem.

Thank you very much!


2008/5/13 Florin A. [EMAIL PROTECTED]:

 Hi,

 Kamap was designed to only take Mapserver input, yes.
 Mapserver will take most formats.  You can have data in shapefiles, in
 a database, a raster image, or in a text file.
 Do you have polygons for the cities or do you want to just draw a
 circle at their lat/long ?



 On Mon, May 12, 2008 at 4:20 PM, Emilio Ponce [EMAIL PROTECTED] wrote:
  Hi everyone,
 
  I'm working with mapserver using ka-map. Now I'm trying to create a new
  layer over the others using alphanumeric data, and  I was wondering
  what's
  the best method.
  My idea is to represent this data with a colour gradient. For example if
 the
  data are like this:
 
  City  Population
  ---
  Barcelona 400
  Madrid  700
 
  I want to represent the Barcelona area with a light red colour, and
 Madrid
  with a darker red.
  Someone told me that the only input to Ka-map is mapserver, and
 mapserver
  uses GDAL/OGR library for this kind of tasks... so what is the best kind
 of
  input format using this library? And in order to represent the data with
 the
  colour gradient, where I have to link the alphanumeric data (e.g
 400)
  with the colour (e.g. dark red)?
 
  Thank you very much guys!
 
 
 
  ___
   mapserver-users mailing list
   mapserver-users@lists.osgeo.org
   http://lists.osgeo.org/mailman/listinfo/mapserver-users
 
 




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


[mapserver-users] Customized layer for Mapserver/Kamap

2008-05-12 Thread Emilio Ponce
Hi everyone,

I'm working with mapserver using ka-map. Now I'm trying to create a new
layer over the others using alphanumeric data, and  I was wondering  what's
the best method.
My idea is to represent this data with a colour gradient. For example if the
data are like this:

City  Population
---
Barcelona 400
Madrid  700

I want to represent the Barcelona area with a light red colour, and Madrid
with a darker red.
Someone told me that the only input to Ka-map is mapserver, and mapserver
uses GDAL/OGR library for this kind of tasks... so what is the best kind of
input format using this library? And in order to represent the data with the
colour gradient, where I have to link the alphanumeric data (e.g 400)
with the colour (e.g. dark red)?

Thank you very much guys!
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Customized layer for Mapserver/Kamap

2008-05-12 Thread Florin A.
Hi,

Kamap was designed to only take Mapserver input, yes.
Mapserver will take most formats.  You can have data in shapefiles, in
a database, a raster image, or in a text file.
Do you have polygons for the cities or do you want to just draw a
circle at their lat/long ?



On Mon, May 12, 2008 at 4:20 PM, Emilio Ponce [EMAIL PROTECTED] wrote:
 Hi everyone,

 I'm working with mapserver using ka-map. Now I'm trying to create a new
 layer over the others using alphanumeric data, and  I was wondering  what's
 the best method.
 My idea is to represent this data with a colour gradient. For example if the
 data are like this:

 City  Population
 ---
 Barcelona 400
 Madrid  700

 I want to represent the Barcelona area with a light red colour, and Madrid
 with a darker red.
 Someone told me that the only input to Ka-map is mapserver, and mapserver
 uses GDAL/OGR library for this kind of tasks... so what is the best kind of
 input format using this library? And in order to represent the data with the
 colour gradient, where I have to link the alphanumeric data (e.g 400)
 with the colour (e.g. dark red)?

 Thank you very much guys!



 ___
  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