Re: [mapserver-users] Rendering Challenges

2011-05-10 Thread thomas bonfort
Brent,

those are interesting questions

On Mon, May 9, 2011 at 21:51, Brent Fraser bfra...@geoanalytic.com wrote:
  While testing v6, I can up with the following list of things I couldn't do
 (see http://i56.tinypic.com/8vvprn.png for a graphic):

 1. Render lines inside polygon boundary (with or without opacity)
Along with Steve's buffer proposition, you can already more or less do
that with OFFSET , except you don't have the notion of inside/outside,
but left/right. If all your polygons are digitized in the same
direction (i.e. clockwise or anticlockwise) this can be done with:

STYLE
  #FILL
END
STYLE
   OUTLINECOLOR r g b
   OFFSET 1.5 -99
   WIDTH 3
   OPACITY 50
END



 2. Place polygon annotation on/inside boundary line
 (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
not possible in a single step, but by using the polygon layer a second
time in a TYPE LINE layer for labelling should get you close.

 3. Rotate anno if required to fit inside a polygon
would be a nice addition, ANGLE AUTO for polygon labels. We should
probably give some way to define if the label should always follow the
longest polygon diagonal, or if it should be first placed horizontally
and fall back to automatic angling only if the horizontal one does not
fit.

 4. Place polygon annotation outside polygon if anno doesn't fit inside
The fine tuning on how to place the label text compared to the feature
would require new mapfile keywords, but that would seem possible to
implement. I'm not sure these kind of automatic adjustments would
really enhance the rendered quality though.

 5. Place line anno above (or below) when using ANGLE FOLLOW
This is something I would like to add to. There's a paper detailing
the underlying algorithm here:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970

 6. Rotate vector symbols to follow lines (a font might work but is a pain to
 create)
how is this different than what we already have with a negative GAP?
On a side note, vector symbols are currently rather ill-defined in
mapserver and would need to be tightened up before being able to use
them for precise symbol placement like here.

 7. User specified character spacing
SIZE AUTO for labels in polygon layers would be a nice addition. We'd
have to be able to define how the size of the font varies in
accordance with the spacing that is applied between characters.
Before going down that road, we shall have to implement the
refactoring proposed in http://trac.osgeo.org/mapserver/ticket/3611 so
as not to clutter the glyph rendering functions of each renderer.


 8. Erase lines (but not other objects) under annotation
This seems rather involved. It would be difficult to keep the ordering
of layers, as the modified feature could only be drawn during the
labelcache phase, i.e. after all other features in the map.


  My goal was to use the published shp files
 (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
 without modification and see how close I could get to the published PDF
 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).

  Any suggested rendering techniques are appreciated.  I'll file tickets for
 those problems deemed worthy.

So, most of these enhancements seem possible, some were already on my
laundry-list of rendering enhancements I'd like to tackle. Creating
enhancement tickets for those features is a first step, and funding
them is the second ;)

regards,

thomas


 --
 Best Regards,
 Brent Fraser


 ___
 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] Rendering Challenges

2011-05-10 Thread Brent Fraser

Using

  STYLE
GEOMTRANSFORM difference([shape],buffer([shape], -5))
COLOR255 211 127
  END

results in the entire original polygon being filled.

Using
GEOMTRANSFORM (difference([shape],buffer([shape], -5)))
results in no fill.

Best Regards,
Brent Fraser


On 5/9/2011 4:20 PM, Lime, Steve D (DNR) wrote:

That's were a difference operator might come in handy since you're looking for 
more of a fill-type effect:

   GEOMTRANSFORM (difference([shape], buffer([shape], -2)))

or something like that.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Monday, May 09, 2011 5:18 PM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Steve L.,

Good point;  I couldn't do any of this in pre-6.0 either!

I tried the buffer and it worked great (but we might have to work on
the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

Best Regards,
Brent Fraser


On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:

These aren't specific to 6.0 though- more of a wish list...

Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
really an expression and I exposed
the GEOS buffer operator as a proof-of-concept. For example:

STYLE
GEOMTRANSFORM (buffer([shape], -2))
OUTLINECOLOR 255 0 0
END

Should generate a single pixel red line on the inside of a polygon shape. You 
can render it however you'd like.
Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
image coordinates so it's effective
for rendering effects only.

If we exposed a few others you'd be able to do some other interesting things 
(like fills just inside a line...).

The rest of the ideas are interesting and worthy of discussion.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
Sent: Monday, May 09, 2011 2:52 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Rendering Challenges

 While testing v6, I can up with the following list of things I
couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation

 My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


 Any suggested rendering techniques are appreciated.  I'll file
tickets for those problems deemed worthy.







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


Re: [mapserver-users] Rendering Challenges

2011-05-10 Thread Brent Fraser

Thomas,

  Interesting. I suspect all the polygons are digitized the same was as 
I think this is a requirement for shapefiles.  The result of using:


  STYLE
OUTLINECOLOR 255 211 127
OFFSET 1.5 -99
WIDTH 3
  END

results in http://i54.tinypic.com/25a22k4.jpg  Close, but notice the 
bleed outside the polygon at the sharp corners.


Thanks!

Best Regards,
Brent Fraser


On 5/10/2011 1:38 AM, thomas bonfort wrote:

Brent,

those are interesting questions

On Mon, May 9, 2011 at 21:51, Brent Fraserbfra...@geoanalytic.com  wrote:

  While testing v6, I can up with the following list of things I couldn't do
(see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)

Along with Steve's buffer proposition, you can already more or less do
that with OFFSET , except you don't have the notion of inside/outside,
but left/right. If all your polygons are digitized in the same
direction (i.e. clockwise or anticlockwise) this can be done with:

STYLE
   #FILL
END
STYLE
OUTLINECOLOR r g b
OFFSET 1.5 -99
WIDTH 3
OPACITY 50
END




2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)

not possible in a single step, but by using the polygon layer a second
time in a TYPE LINE layer for labelling should get you close.


3. Rotate anno if required to fit inside a polygon

would be a nice addition, ANGLE AUTO for polygon labels. We should
probably give some way to define if the label should always follow the
longest polygon diagonal, or if it should be first placed horizontally
and fall back to automatic angling only if the horizontal one does not
fit.


4. Place polygon annotation outside polygon if anno doesn't fit inside

The fine tuning on how to place the label text compared to the feature
would require new mapfile keywords, but that would seem possible to
implement. I'm not sure these kind of automatic adjustments would
really enhance the rendered quality though.


5. Place line anno above (or below) when using ANGLE FOLLOW

This is something I would like to add to. There's a paper detailing
the underlying algorithm here:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970


6. Rotate vector symbols to follow lines (a font might work but is a pain to
create)

how is this different than what we already have with a negative GAP?
On a side note, vector symbols are currently rather ill-defined in
mapserver and would need to be tightened up before being able to use
them for precise symbol placement like here.


7. User specified character spacing

SIZE AUTO for labels in polygon layers would be a nice addition. We'd
have to be able to define how the size of the font varies in
accordance with the spacing that is applied between characters.
Before going down that road, we shall have to implement the
refactoring proposed in http://trac.osgeo.org/mapserver/ticket/3611 so
as not to clutter the glyph rendering functions of each renderer.



8. Erase lines (but not other objects) under annotation

This seems rather involved. It would be difficult to keep the ordering
of layers, as the modified feature could only be drawn during the
labelcache phase, i.e. after all other features in the map.


  My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).

  Any suggested rendering techniques are appreciated.  I'll file tickets for
those problems deemed worthy.

So, most of these enhancements seem possible, some were already on my
laundry-list of rendering enhancements I'd like to tackle. Creating
enhancement tickets for those features is a first step, and funding
them is the second ;)

regards,

thomas


--
Best Regards,
Brent Fraser


___
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] Rendering Challenges

2011-05-10 Thread Lime, Steve D (DNR)
I don't have a difference operator implemented. Wouldn't take much though...

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com] 
Sent: Tuesday, May 10, 2011 9:07 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Using

   STYLE
 GEOMTRANSFORM difference([shape],buffer([shape], -5))
 COLOR255 211 127
   END

results in the entire original polygon being filled.

Using
 GEOMTRANSFORM (difference([shape],buffer([shape], -5)))
results in no fill.

Best Regards,
Brent Fraser


On 5/9/2011 4:20 PM, Lime, Steve D (DNR) wrote:
 That's were a difference operator might come in handy since you're looking 
 for more of a fill-type effect:

GEOMTRANSFORM (difference([shape], buffer([shape], -2)))

 or something like that.

 Steve

 -Original Message-
 From: Brent Fraser [mailto:bfra...@geoanalytic.com]
 Sent: Monday, May 09, 2011 5:18 PM
 To: Lime, Steve D (DNR)
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] Rendering Challenges

 Steve L.,

 Good point;  I couldn't do any of this in pre-6.0 either!

 I tried the buffer and it worked great (but we might have to work on
 the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

 Best Regards,
 Brent Fraser


 On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:
 These aren't specific to 6.0 though- more of a wish list...

 Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
 really an expression and I exposed
 the GEOS buffer operator as a proof-of-concept. For example:

 STYLE
 GEOMTRANSFORM (buffer([shape], -2))
 OUTLINECOLOR 255 0 0
 END

 Should generate a single pixel red line on the inside of a polygon shape. 
 You can render it however you'd like.
 Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map 
 to image coordinates so it's effective
 for rendering effects only.

 If we exposed a few others you'd be able to do some other interesting things 
 (like fills just inside a line...).

 The rest of the ideas are interesting and worthy of discussion.

 Steve

 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
 Sent: Monday, May 09, 2011 2:52 PM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Rendering Challenges

  While testing v6, I can up with the following list of things I
 couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

 1. Render lines inside polygon boundary (with or without opacity)
 2. Place polygon annotation on/inside boundary line
 (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
 3. Rotate anno if required to fit inside a polygon
 4. Place polygon annotation outside polygon if anno doesn't fit inside
 5. Place line anno above (or below) when using ANGLE FOLLOW
 6. Rotate vector symbols to follow lines (a font might work but is a
 pain to create)
 7. User specified character spacing
 8. Erase lines (but not other objects) under annotation

  My goal was to use the published shp files
 (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
 without modification and see how close I could get to the published PDF
 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


  Any suggested rendering techniques are appreciated.  I'll file
 tickets for those problems deemed worthy.







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


Re: [mapserver-users] Rendering Challenges

2011-05-10 Thread thomas bonfort
Yes, offset is intended for lines, using it on polygons is abusing it.
the buffer+difference method is probably the way to go.

note to myself and steve: the OFFSET keyword should be moved into a
GEOMTRANSFORM instead of residing in a keyword of its own.

--
thomas

On Tue, May 10, 2011 at 16:21, Brent Fraser bfra...@geoanalytic.com wrote:
 Thomas,

  Interesting. I suspect all the polygons are digitized the same was as I
 think this is a requirement for shapefiles.  The result of using:

      STYLE
        OUTLINECOLOR 255 211 127
        OFFSET 1.5 -99
        WIDTH 3
      END

 results in http://i54.tinypic.com/25a22k4.jpg  Close, but notice the bleed
 outside the polygon at the sharp corners.

 Thanks!

 Best Regards,
 Brent Fraser


 On 5/10/2011 1:38 AM, thomas bonfort wrote:

 Brent,

 those are interesting questions

 On Mon, May 9, 2011 at 21:51, Brent Fraserbfra...@geoanalytic.com
  wrote:

  While testing v6, I can up with the following list of things I couldn't
 do
 (see http://i56.tinypic.com/8vvprn.png for a graphic):

 1. Render lines inside polygon boundary (with or without opacity)

 Along with Steve's buffer proposition, you can already more or less do
 that with OFFSET , except you don't have the notion of inside/outside,
 but left/right. If all your polygons are digitized in the same
 direction (i.e. clockwise or anticlockwise) this can be done with:

 STYLE
   #FILL
 END
 STYLE
    OUTLINECOLOR r g b
    OFFSET 1.5 -99
    WIDTH 3
    OPACITY 50
 END



 2. Place polygon annotation on/inside boundary line
 (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)

 not possible in a single step, but by using the polygon layer a second
 time in a TYPE LINE layer for labelling should get you close.

 3. Rotate anno if required to fit inside a polygon

 would be a nice addition, ANGLE AUTO for polygon labels. We should
 probably give some way to define if the label should always follow the
 longest polygon diagonal, or if it should be first placed horizontally
 and fall back to automatic angling only if the horizontal one does not
 fit.

 4. Place polygon annotation outside polygon if anno doesn't fit inside

 The fine tuning on how to place the label text compared to the feature
 would require new mapfile keywords, but that would seem possible to
 implement. I'm not sure these kind of automatic adjustments would
 really enhance the rendered quality though.

 5. Place line anno above (or below) when using ANGLE FOLLOW

 This is something I would like to add to. There's a paper detailing
 the underlying algorithm here:
 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970

 6. Rotate vector symbols to follow lines (a font might work but is a pain
 to
 create)

 how is this different than what we already have with a negative GAP?
 On a side note, vector symbols are currently rather ill-defined in
 mapserver and would need to be tightened up before being able to use
 them for precise symbol placement like here.

 7. User specified character spacing

 SIZE AUTO for labels in polygon layers would be a nice addition. We'd
 have to be able to define how the size of the font varies in
 accordance with the spacing that is applied between characters.
 Before going down that road, we shall have to implement the
 refactoring proposed in http://trac.osgeo.org/mapserver/ticket/3611 so
 as not to clutter the glyph rendering functions of each renderer.


 8. Erase lines (but not other objects) under annotation

 This seems rather involved. It would be difficult to keep the ordering
 of layers, as the modified feature could only be drawn during the
 labelcache phase, i.e. after all other features in the map.

  My goal was to use the published shp files

 (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
 without modification and see how close I could get to the published PDF

 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).

  Any suggested rendering techniques are appreciated.  I'll file tickets
 for
 those problems deemed worthy.

 So, most of these enhancements seem possible, some were already on my
 laundry-list of rendering enhancements I'd like to tackle. Creating
 enhancement tickets for those features is a first step, and funding
 them is the second ;)

 regards,

 thomas

 --
 Best Regards,
 Brent Fraser


 ___
 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] Rendering Challenges

2011-05-10 Thread Brent Fraser

I think it would be very valuable

Best Regards,
Brent Fraser


On 5/10/2011 8:25 AM, Lime, Steve D (DNR) wrote:

I don't have a difference operator implemented. Wouldn't take much though...

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Tuesday, May 10, 2011 9:07 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Using

STYLE
  GEOMTRANSFORM difference([shape],buffer([shape], -5))
  COLOR255 211 127
END

results in the entire original polygon being filled.

Using
  GEOMTRANSFORM (difference([shape],buffer([shape], -5)))
results in no fill.

Best Regards,
Brent Fraser


On 5/9/2011 4:20 PM, Lime, Steve D (DNR) wrote:

That's were a difference operator might come in handy since you're looking for 
more of a fill-type effect:

GEOMTRANSFORM (difference([shape], buffer([shape], -2)))

or something like that.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Monday, May 09, 2011 5:18 PM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Steve L.,

 Good point;  I couldn't do any of this in pre-6.0 either!

 I tried the buffer and it worked great (but we might have to work on
the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

Best Regards,
Brent Fraser


On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:

These aren't specific to 6.0 though- more of a wish list...

Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
really an expression and I exposed
the GEOS buffer operator as a proof-of-concept. For example:

STYLE
 GEOMTRANSFORM (buffer([shape], -2))
 OUTLINECOLOR 255 0 0
END

Should generate a single pixel red line on the inside of a polygon shape. You 
can render it however you'd like.
Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
image coordinates so it's effective
for rendering effects only.

If we exposed a few others you'd be able to do some other interesting things 
(like fills just inside a line...).

The rest of the ideas are interesting and worthy of discussion.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
Sent: Monday, May 09, 2011 2:52 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Rendering Challenges

  While testing v6, I can up with the following list of things I
couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation

  My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


  Any suggested rendering techniques are appreciated.  I'll file
tickets for those problems deemed worthy.










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


RE: [mapserver-users] Rendering Challenges

2011-05-10 Thread Lime, Steve D (DNR)
I've attached a patch against trunk that adds the difference function. It's 
untested, give it a whirl and
let me know how it goes... You'll have to re-build the lexer and parser.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com] 
Sent: Tuesday, May 10, 2011 9:42 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

I think it would be very valuable

Best Regards,
Brent Fraser


On 5/10/2011 8:25 AM, Lime, Steve D (DNR) wrote:
 I don't have a difference operator implemented. Wouldn't take much though...

 -Original Message-
 From: Brent Fraser [mailto:bfra...@geoanalytic.com]
 Sent: Tuesday, May 10, 2011 9:07 AM
 To: Lime, Steve D (DNR)
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] Rendering Challenges

 Using

 STYLE
   GEOMTRANSFORM difference([shape],buffer([shape], -5))
   COLOR255 211 127
 END

 results in the entire original polygon being filled.

 Using
   GEOMTRANSFORM (difference([shape],buffer([shape], -5)))
 results in no fill.

 Best Regards,
 Brent Fraser


 On 5/9/2011 4:20 PM, Lime, Steve D (DNR) wrote:
 That's were a difference operator might come in handy since you're looking 
 for more of a fill-type effect:

 GEOMTRANSFORM (difference([shape], buffer([shape], -2)))

 or something like that.

 Steve

 -Original Message-
 From: Brent Fraser [mailto:bfra...@geoanalytic.com]
 Sent: Monday, May 09, 2011 5:18 PM
 To: Lime, Steve D (DNR)
 Cc: mapserver-users@lists.osgeo.org
 Subject: Re: [mapserver-users] Rendering Challenges

 Steve L.,

  Good point;  I couldn't do any of this in pre-6.0 either!

  I tried the buffer and it worked great (but we might have to work on
 the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

 Best Regards,
 Brent Fraser


 On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:
 These aren't specific to 6.0 though- more of a wish list...

 Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
 really an expression and I exposed
 the GEOS buffer operator as a proof-of-concept. For example:

 STYLE
  GEOMTRANSFORM (buffer([shape], -2))
  OUTLINECOLOR 255 0 0
 END

 Should generate a single pixel red line on the inside of a polygon shape. 
 You can render it however you'd like.
 Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map 
 to image coordinates so it's effective
 for rendering effects only.

 If we exposed a few others you'd be able to do some other interesting 
 things (like fills just inside a line...).

 The rest of the ideas are interesting and worthy of discussion.

 Steve

 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
 Sent: Monday, May 09, 2011 2:52 PM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Rendering Challenges

   While testing v6, I can up with the following list of things I
 couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

 1. Render lines inside polygon boundary (with or without opacity)
 2. Place polygon annotation on/inside boundary line
 (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
 3. Rotate anno if required to fit inside a polygon
 4. Place polygon annotation outside polygon if anno doesn't fit inside
 5. Place line anno above (or below) when using ANGLE FOLLOW
 6. Rotate vector symbols to follow lines (a font might work but is a
 pain to create)
 7. User specified character spacing
 8. Erase lines (but not other objects) under annotation

   My goal was to use the published shp files
 (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
 without modification and see how close I could get to the published PDF
 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


   Any suggested rendering techniques are appreciated.  I'll file
 tickets for those problems deemed worthy.










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


Re: [mapserver-users] Rendering Challenges

2011-05-10 Thread Brent Fraser

Steve,

So I've done

C:\svn -r 11667 co https://svn.osgeo.org/mapserver/trunk/mapserver 
mapserver-6.0.0-r11667


C:\ mapserver-6.0.0-r11667 patch  difference.patch
  patching file mapparser.y
  patching file mapserver.h
  patching file maplexer.l

C:\ mapserver-6.0.0-r11667 flex  -Pmsyy -i -omaplexer.c maplexer.l

but my make results in:

   Creating library mapserver_i.lib and object mapserver_i.exp
mapfile.obj : error LNK2019: unresolved external symbol _msyylex_destroy 
referenced in function _msUpdateLabelFromString

maputil.obj : error LNK2001: unresolved external symbol _msyylex_destroy

Did I miss a step?

Best Regards,
Brent Fraser


On 5/10/2011 9:32 AM, Lime, Steve D (DNR) wrote:

I've attached a patch against trunk that adds the difference function. It's 
untested, give it a whirl and
let me know how it goes... You'll have to re-build the lexer and parser.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Tuesday, May 10, 2011 9:42 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

I think it would be very valuable

Best Regards,
Brent Fraser


On 5/10/2011 8:25 AM, Lime, Steve D (DNR) wrote:

I don't have a difference operator implemented. Wouldn't take much though...

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Tuesday, May 10, 2011 9:07 AM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Using

 STYLE
   GEOMTRANSFORM difference([shape],buffer([shape], -5))
   COLOR255 211 127
 END

results in the entire original polygon being filled.

Using
   GEOMTRANSFORM (difference([shape],buffer([shape], -5)))
results in no fill.

Best Regards,
Brent Fraser


On 5/9/2011 4:20 PM, Lime, Steve D (DNR) wrote:

That's were a difference operator might come in handy since you're looking for 
more of a fill-type effect:

 GEOMTRANSFORM (difference([shape], buffer([shape], -2)))

or something like that.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com]
Sent: Monday, May 09, 2011 5:18 PM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Steve L.,

  Good point;  I couldn't do any of this in pre-6.0 either!

  I tried the buffer and it worked great (but we might have to work on
the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

Best Regards,
Brent Fraser


On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:

These aren't specific to 6.0 though- more of a wish list...

Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
really an expression and I exposed
the GEOS buffer operator as a proof-of-concept. For example:

STYLE
  GEOMTRANSFORM (buffer([shape], -2))
  OUTLINECOLOR 255 0 0
END

Should generate a single pixel red line on the inside of a polygon shape. You 
can render it however you'd like.
Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
image coordinates so it's effective
for rendering effects only.

If we exposed a few others you'd be able to do some other interesting things 
(like fills just inside a line...).

The rest of the ideas are interesting and worthy of discussion.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
Sent: Monday, May 09, 2011 2:52 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Rendering Challenges

   While testing v6, I can up with the following list of things I
couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation

   My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


   Any suggested rendering techniques are appreciated.  I'll file
tickets for those problems deemed worthy.










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


Re: [mapserver-users] Rendering Challenges

2011-05-09 Thread Stephen Woodbridge

Brent,

I think this is an excellent list of features that we should strive to 
support in mapserver. I here that you ideal stated goal is to use the 
files as published, but as a close alternative I can see that having a 
utility to preprocess the files might make implementation faster and and 
more consistent. This thought is based on some simple ideas:


1. what is inside/outside of a polygon? While we can compute this for 
every polygon on every draw, I do not think we want to do that, so 
having a preprocessor that standardizes polygon node ordering would 
avoid this.


2. polygon label point and orientations. It would be nice to have a 
utility, or the one above, that can do some basic analysis of a polygon 
and pick the ideal label point and orientation. This then might create a 
companion label point shapefile or add additional attribute columns for 
this purpose. This approach also has the benefit that you could then 
edit the label point file to override the automatically generated point.


I think these two items would greatly increase our ability to implement 
in a consistent manner items 1, 2, 3, and 4.


On 5/9/2011 3:51 PM, Brent Fraser wrote:

While testing v6, I can up with the following list of things I couldn't
do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation


For this one, do you want to erase ALL lines or just suspend drawing the 
line of the object being labeled? If you truely want to erase all lines, 
then you have to define what is a line! antialiased? wide lines? how is 
a line different from the highlighted edge of a polygon? or a line that 
has been drawn as a wide street with shoulders and a centerline?


Currently we support drawing a multi-pixel halo around the text the in 
effect erases/replaces everything under the halo.


I like your example image as a great use case.

Thanks,
  -Steve



My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


Any suggested rendering techniques are appreciated. I'll file tickets
for those problems deemed worthy.



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


RE: [mapserver-users] Rendering Challenges

2011-05-09 Thread Lime, Steve D (DNR)
These aren't specific to 6.0 though- more of a wish list...

Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
really an expression and I exposed
the GEOS buffer operator as a proof-of-concept. For example:

STYLE
  GEOMTRANSFORM (buffer([shape], -2))
  OUTLINECOLOR 255 0 0
END

Should generate a single pixel red line on the inside of a polygon shape. You 
can render it however you'd like.
Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
image coordinates so it's effective
for rendering effects only.

If we exposed a few others you'd be able to do some other interesting things 
(like fills just inside a line...).

The rest of the ideas are interesting and worthy of discussion.

Steve  

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
Sent: Monday, May 09, 2011 2:52 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Rendering Challenges

   While testing v6, I can up with the following list of things I 
couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line 
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a 
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation

   My goal was to use the published shp files 
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip) 
without modification and see how close I could get to the published PDF 
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).
 


   Any suggested rendering techniques are appreciated.  I'll file 
tickets for those problems deemed worthy.

-- 
Best Regards,
Brent Fraser


___
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] Rendering Challenges

2011-05-09 Thread Brent Fraser

Steve W.,

  The reason I'd like to minimize any pre-processing is that NRCan 
publishes about 30 GB of shapefiles for the map series.  And they 
publish a complete new version of these every 6 months.  Currently I 
build tileindexes, and I expect I'll have to do other pre-processing 
steps to get the rendered output I'd like.  The answer may be to load 
the data into PostGIS (every 6 months) and use its functions to make the 
data suitable for Mapserver.  Maybe not.


  I've been thinking about a pre-processing commandline utility based 
on OGR and the GEOS functions it supports (and other functions it will 
hopefully support in the future).  One thing  I have to do is a 
LineMerge on the rivers shapefile so they will label in Mapserver.  
Currently a river will have many short segments broken at every 
tributary preventing any segment to be long enough to support a label.


  Having a separate pre-calculated shapefile for polygon annotation 
might get me closer to my goal.  Dunno about the impact of having to 
support any arbitrary scale the user may view the map...  NRCan's 
cartographers have it easy; they just have to render the data a one 
scale!  And since it is [just] basemap data I suppose I could use Mapnik 
to render tiles, but that feels wrong.  I'd much rather help to improve 
Mapserver.


  As for the erasing of lines, I want just the contour lines under 
the label not to be drawn.  I've used OUTLINECOLOR in the past but have 
been unhappy with the results (segments visible between characters, 
other features erased).  I suppose the lines could be clipped to the 
bounding boxes of the contour labels, but due to the potentially curved 
nature of the contour labels I think the clipping polygons would have to 
be something like the convex hull of the character boxes.


Best Regards,
Brent Fraser


On 5/9/2011 2:30 PM, Stephen Woodbridge wrote:

Brent,

I think this is an excellent list of features that we should strive to 
support in mapserver. I here that you ideal stated goal is to use the 
files as published, but as a close alternative I can see that having a 
utility to preprocess the files might make implementation faster and 
and more consistent. This thought is based on some simple ideas:


1. what is inside/outside of a polygon? While we can compute this for 
every polygon on every draw, I do not think we want to do that, so 
having a preprocessor that standardizes polygon node ordering would 
avoid this.


2. polygon label point and orientations. It would be nice to have a 
utility, or the one above, that can do some basic analysis of a 
polygon and pick the ideal label point and orientation. This then 
might create a companion label point shapefile or add additional 
attribute columns for this purpose. This approach also has the benefit 
that you could then edit the label point file to override the 
automatically generated point.


I think these two items would greatly increase our ability to 
implement in a consistent manner items 1, 2, 3, and 4.


On 5/9/2011 3:51 PM, Brent Fraser wrote:

While testing v6, I can up with the following list of things I couldn't
do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation


For this one, do you want to erase ALL lines or just suspend drawing 
the line of the object being labeled? If you truely want to erase all 
lines, then you have to define what is a line! antialiased? wide 
lines? how is a line different from the highlighted edge of a polygon? 
or a line that has been drawn as a wide street with shoulders and a 
centerline?


Currently we support drawing a multi-pixel halo around the text the in 
effect erases/replaces everything under the halo.


I like your example image as a great use case.

Thanks,
  -Steve



My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip) 


without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip). 




Any suggested rendering techniques are appreciated. I'll file tickets
for those problems deemed worthy.



___
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

Re: [mapserver-users] Rendering Challenges

2011-05-09 Thread Brent Fraser

Steve L.,

  Good point;  I couldn't do any of this in pre-6.0 either!

  I tried the buffer and it worked great (but we might have to work on 
the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg


Best Regards,
Brent Fraser


On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:

These aren't specific to 6.0 though- more of a wish list...

Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
really an expression and I exposed
the GEOS buffer operator as a proof-of-concept. For example:

STYLE
   GEOMTRANSFORM (buffer([shape], -2))
   OUTLINECOLOR 255 0 0
END

Should generate a single pixel red line on the inside of a polygon shape. You 
can render it however you'd like.
Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
image coordinates so it's effective
for rendering effects only.

If we exposed a few others you'd be able to do some other interesting things 
(like fills just inside a line...).

The rest of the ideas are interesting and worthy of discussion.

Steve

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
Sent: Monday, May 09, 2011 2:52 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Rendering Challenges

While testing v6, I can up with the following list of things I
couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

1. Render lines inside polygon boundary (with or without opacity)
2. Place polygon annotation on/inside boundary line
(http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
3. Rotate anno if required to fit inside a polygon
4. Place polygon annotation outside polygon if anno doesn't fit inside
5. Place line anno above (or below) when using ANGLE FOLLOW
6. Rotate vector symbols to follow lines (a font might work but is a
pain to create)
7. User specified character spacing
8. Erase lines (but not other objects) under annotation

My goal was to use the published shp files
(http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
without modification and see how close I could get to the published PDF
(http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


Any suggested rendering techniques are appreciated.  I'll file
tickets for those problems deemed worthy.



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


RE: [mapserver-users] Rendering Challenges

2011-05-09 Thread Lime, Steve D (DNR)
That's were a difference operator might come in handy since you're looking for 
more of a fill-type effect:

  GEOMTRANSFORM (difference([shape], buffer([shape], -2)))
  
or something like that.

Steve

-Original Message-
From: Brent Fraser [mailto:bfra...@geoanalytic.com] 
Sent: Monday, May 09, 2011 5:18 PM
To: Lime, Steve D (DNR)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Rendering Challenges

Steve L.,

   Good point;  I couldn't do any of this in pre-6.0 either!

   I tried the buffer and it worked great (but we might have to work on 
the end-cap types in PDF output)! See http://i52.tinypic.com/2qjc9yv.jpg

Best Regards,
Brent Fraser


On 5/9/2011 2:36 PM, Lime, Steve D (DNR) wrote:
 These aren't specific to 6.0 though- more of a wish list...

 Item 1 might be doable in 6.0 as it sits. In 6.0 a style GEOMTRANSFORM is 
 really an expression and I exposed
 the GEOS buffer operator as a proof-of-concept. For example:

 STYLE
GEOMTRANSFORM (buffer([shape], -2))
OUTLINECOLOR 255 0 0
 END

 Should generate a single pixel red line on the inside of a polygon shape. You 
 can render it however you'd like.
 Note that a GEOMTRANSFORM is performed AFTER a shape is converted from map to 
 image coordinates so it's effective
 for rendering effects only.

 If we exposed a few others you'd be able to do some other interesting things 
 (like fills just inside a line...).

 The rest of the ideas are interesting and worthy of discussion.

 Steve

 -Original Message-
 From: mapserver-users-boun...@lists.osgeo.org 
 [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Brent Fraser
 Sent: Monday, May 09, 2011 2:52 PM
 To: mapserver-users@lists.osgeo.org
 Subject: [mapserver-users] Rendering Challenges

 While testing v6, I can up with the following list of things I
 couldn't do (see http://i56.tinypic.com/8vvprn.png for a graphic):

 1. Render lines inside polygon boundary (with or without opacity)
 2. Place polygon annotation on/inside boundary line
 (http://trac.osgeo.org/mapserver/ticket/1592 point 8.)
 3. Rotate anno if required to fit inside a polygon
 4. Place polygon annotation outside polygon if anno doesn't fit inside
 5. Place line anno above (or below) when using ANGLE FOLLOW
 6. Rotate vector symbols to follow lines (a font might work but is a
 pain to create)
 7. User specified character spacing
 8. Erase lines (but not other objects) under annotation

 My goal was to use the published shp files
 (http://ftp2.cits.rncan.gc.ca/pub/canvec/50k_shp/092/h/canvec_092h06_shp.zip)
 without modification and see how close I could get to the published PDF
 (http://ftp2.cits.rncan.gc.ca/pub/cantopo/50k_geopdf/092/h/cantopo_092h06_geopdf.zip).


 Any suggested rendering techniques are appreciated.  I'll file
 tickets for those problems deemed worthy.




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