Re: [mapserver-users] dynamically added shapes and their values

2009-01-22 Thread Pietro Giannini
Dan,
I considered this solution, as well as (Steve) creating a layer for each
classification.

maybe you are right, despite I must to generate a different file for each
user-session: other garbage in tmp dir... :)

possibility of apply a style to a single feature can be a great
functionality for further releases...

what about the STYLEITEM?
http://mapserver.org/mapfile/layer.html?highlight=styleitem
http://mapserver.org/mapscript/mapscript.html?highlight=styleitem
---

thanks all
bye ..pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E


On Mer, Gennaio 21, 2009 22:09, Dan Little wrote:
 Totally spit balling...

 What about writing your layer to a temp. file that's KML/GML.

 The file size is small, it carries the attributes you want, and it's easy
 to  write the file using anything that writes text files (presumable C#
 can write text files ... but I know Microsoft misses little details from
 time to time).

 Then write yourself a little mapfile you can open... maybe following this
 as a guide...
 http://mapserver.org/input/vector/gml.html
 -or-
 http://mapserver.org/input/vector/kml.html

 And just change CONNECTION using Mapscript to whatever the location of
 your newly created KML/GML file happens to be, then proceed with the
 processing.



 - Original Message 
 From: Steve Lime steve.l...@dnr.state.mn.us
 To: Pietro Giannini pgiann...@bytewise.it;
 mapserver-users@lists.osgeo.org
 Sent: Wednesday, January 21, 2009 2:43:31 PM
 Subject: Re: [mapserver-users] dynamically added shapes and their values

 PG: At this point inline feature can carry no attributes and as a result
 cannot
 be
 classified. So I don't think you're going to be able to make this work.
 The work
 around is to use separate layers for what would have been a class and
 add
 features to the appropriate layer.

 Steve

  On 1/21/2009 at 10:29 AM, in message
 55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
 Giannini wrote:
  Hi all,
 
  I'm working to a c# asp.net project embedding a mapscript application.
 
  My attempt is to add dynamically features to a layer object and
 classify
  them in different colors.
  The features are INLINE features: I don't add the features to the
 source
  of the layer.
 
  I'm able to create different classes and styles in the layer, set a
 field
  as classitem and set an EXPRESSION string to the class.
 
  I found the
  shapeObj.initValues(numOfFields)
  method, which cannot set the field names, only the number, and also
 the
  shapeObj.setValue(indexOfField, valueAsString)
  for setting the value.
 
  Now I need a field name to set a CLASSITEM property of the layer!!!
  I found no methods to add a named field to the layer.
 
  Maybe I follow a wrong way...
 
  Someone has an idea?
  thanks in advance
  ...pg
 
 

 ___
 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] dynamically added shapes and their values

2009-01-22 Thread Tamas Szekeres
2009/1/22 Steve Lime steve.l...@dnr.state.mn.us

 Could consider for 5.4 I guess. The layer iteminfo would need to be
 populated somehow
 for inline layers then. Tamas, something you want to take on?


I'll have a shot at it.


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


[mapserver-users] dynamically added shapes and their values

2009-01-21 Thread Pietro Giannini
Hi all,

I'm working to a c# asp.net project embedding a mapscript application.

My attempt is to add dynamically features to a layer object and classify
them in different colors.
The features are INLINE features: I don't add the features to the source
of the layer.

I'm able to create different classes and styles in the layer, set a field
as classitem and set an EXPRESSION string to the class.

I found the
shapeObj.initValues(numOfFields)
method, which cannot set the field names, only the number, and also the
shapeObj.setValue(indexOfField, valueAsString)
for setting the value.

Now I need a field name to set a CLASSITEM property of the layer!!!
I found no methods to add a named field to the layer.

Maybe I follow a wrong way...

Someone has an idea?
thanks in advance
...pg



-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58N 12°29'13.39E

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


Re: [mapserver-users] dynamically added shapes and their values

2009-01-21 Thread Steve Lime
PG: At this point inline feature can carry no attributes and as a result cannot 
be
classified. So I don't think you're going to be able to make this work. The work
around is to use separate layers for what would have been a class and add
features to the appropriate layer.

Steve

 On 1/21/2009 at 10:29 AM, in message
55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
Giannini pgiann...@bytewise.it wrote:
 Hi all,
 
 I'm working to a c# asp.net project embedding a mapscript application.
 
 My attempt is to add dynamically features to a layer object and classify
 them in different colors.
 The features are INLINE features: I don't add the features to the source
 of the layer.
 
 I'm able to create different classes and styles in the layer, set a field
 as classitem and set an EXPRESSION string to the class.
 
 I found the
 shapeObj.initValues(numOfFields)
 method, which cannot set the field names, only the number, and also the
 shapeObj.setValue(indexOfField, valueAsString)
 for setting the value.
 
 Now I need a field name to set a CLASSITEM property of the layer!!!
 I found no methods to add a named field to the layer.
 
 Maybe I follow a wrong way...
 
 Someone has an idea?
 thanks in advance
 ...pg
 
 

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


Re: [mapserver-users] dynamically added shapes and their values

2009-01-21 Thread Dan Little
Totally spit balling...

What about writing your layer to a temp. file that's KML/GML.

The file size is small, it carries the attributes you want, and it's easy to  
write the file using anything that writes text files (presumable C# can write 
text files ... but I know Microsoft misses little details from time to time).

Then write yourself a little mapfile you can open... maybe following this as a 
guide...
http://mapserver.org/input/vector/gml.html
-or-
http://mapserver.org/input/vector/kml.html

And just change CONNECTION using Mapscript to whatever the location of your 
newly created KML/GML file happens to be, then proceed with the processing.



- Original Message 
 From: Steve Lime steve.l...@dnr.state.mn.us
 To: Pietro Giannini pgiann...@bytewise.it; mapserver-users@lists.osgeo.org
 Sent: Wednesday, January 21, 2009 2:43:31 PM
 Subject: Re: [mapserver-users] dynamically added shapes and their values
 
 PG: At this point inline feature can carry no attributes and as a result 
 cannot 
 be
 classified. So I don't think you're going to be able to make this work. The 
 work
 around is to use separate layers for what would have been a class and add
 features to the appropriate layer.
 
 Steve
 
  On 1/21/2009 at 10:29 AM, in message
 55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
 Giannini wrote:
  Hi all,
  
  I'm working to a c# asp.net project embedding a mapscript application.
  
  My attempt is to add dynamically features to a layer object and classify
  them in different colors.
  The features are INLINE features: I don't add the features to the source
  of the layer.
  
  I'm able to create different classes and styles in the layer, set a field
  as classitem and set an EXPRESSION string to the class.
  
  I found the
  shapeObj.initValues(numOfFields)
  method, which cannot set the field names, only the number, and also the
  shapeObj.setValue(indexOfField, valueAsString)
  for setting the value.
  
  Now I need a field name to set a CLASSITEM property of the layer!!!
  I found no methods to add a named field to the layer.
  
  Maybe I follow a wrong way...
  
  Someone has an idea?
  thanks in advance
  ...pg
  
  
 
 ___
 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] dynamically added shapes and their values

2009-01-21 Thread Tamas Szekeres
Steve,

I think however it would be quite an easy to suppress the whichitems
functionality for the inline layers and expose msLayerSetItems to the SWIG
interface so as to achieve the desired effect.


Best regards,

Tamas




2009/1/21 Steve Lime steve.l...@dnr.state.mn.us

 PG: At this point inline feature can carry no attributes and as a result
 cannot be
 classified. So I don't think you're going to be able to make this work. The
 work
 around is to use separate layers for what would have been a class and add
 features to the appropriate layer.

 Steve

  On 1/21/2009 at 10:29 AM, in message
 55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
 Giannini pgiann...@bytewise.it wrote:
  Hi all,
 
  I'm working to a c# asp.net project embedding a mapscript application.
 
  My attempt is to add dynamically features to a layer object and classify
  them in different colors.
  The features are INLINE features: I don't add the features to the source
  of the layer.
 
  I'm able to create different classes and styles in the layer, set a field
  as classitem and set an EXPRESSION string to the class.
 
  I found the
  shapeObj.initValues(numOfFields)
  method, which cannot set the field names, only the number, and also the
  shapeObj.setValue(indexOfField, valueAsString)
  for setting the value.
 
  Now I need a field name to set a CLASSITEM property of the layer!!!
  I found no methods to add a named field to the layer.
 
  Maybe I follow a wrong way...
 
  Someone has an idea?
  thanks in advance
  ...pg
 
 

 ___
 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] dynamically added shapes and their values

2009-01-21 Thread Steve Lime
Could consider for 5.4 I guess. The layer iteminfo would need to be populated 
somehow
for inline layers then. Tamas, something you want to take on?

Steve

 Tamas Szekeres szeker...@gmail.com 01/21/09 4:42 PM 
Steve,

I think however it would be quite an easy to suppress the whichitems
functionality for the inline layers and expose msLayerSetItems to the SWIG
interface so as to achieve the desired effect.


Best regards,

Tamas




2009/1/21 Steve Lime steve.l...@dnr.state.mn.us

 PG: At this point inline feature can carry no attributes and as a result
 cannot be
 classified. So I don't think you're going to be able to make this work. The
 work
 around is to use separate layers for what would have been a class and add
 features to the appropriate layer.

 Steve

  On 1/21/2009 at 10:29 AM, in message
 55312.89.97.235.106.1232555376.squir...@localhost.localdomain, Pietro
 Giannini pgiann...@bytewise.it wrote:
  Hi all,
 
  I'm working to a c# asp.net project embedding a mapscript application.
 
  My attempt is to add dynamically features to a layer object and classify
  them in different colors.
  The features are INLINE features: I don't add the features to the source
  of the layer.
 
  I'm able to create different classes and styles in the layer, set a field
  as classitem and set an EXPRESSION string to the class.
 
  I found the
  shapeObj.initValues(numOfFields)
  method, which cannot set the field names, only the number, and also the
  shapeObj.setValue(indexOfField, valueAsString)
  for setting the value.
 
  Now I need a field name to set a CLASSITEM property of the layer!!!
  I found no methods to add a named field to the layer.
 
  Maybe I follow a wrong way...
 
  Someone has an idea?
  thanks in advance
  ...pg
 
 

 ___
 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