[postgis-users] how to create a hole in a polygon table?

Paul Ramsey pramsey at opengeo.org
Wed Feb 29 10:17:32 PST 2012


Note that I don't know the correct syntax, but functionally, I would
expect this to work...

Difference(geom, Buffer(geom, -something))

P.

On Tue, Feb 28, 2012 at 10:06 PM, Robert Buckley
<robertdbuckley at yahoo.com> wrote:
> Thanks for that...shame it didn´t work.
>
> I have already looked at negative buffers, but they create a polygon within
> a polygon and not a hole within a "negative-buffered" polyon. i.e my polygon
> needs to be transparent in the center past the negative buffer so underlying
> features can be seen.
>
> Andrea Aime thought it could be done with the "Difference" SLD filter, but I
> can´t seem to get it to work due to my lack of understanding of how the
> filter works.
>
> http://docs.geoserver.org/latest/en/user/styling/sld-reference/filters.html
>
> yours,
>
> Rob
>
>
>
>
>
> ________________________________
> Von: Paul Ramsey <pramsey at opengeo.org>
> An: Robert Buckley <robertdbuckley at yahoo.com>; PostGIS Users Discussion
> <postgis-users at postgis.refractions.net>
> Gesendet: 22:33 Dienstag, 28.Februar 2012
>
> Betreff: Re: [postgis-users] how to create a hole in a polygon table?
>
> I was thinking of something like this, but it doesn't work.
> Unfortunately Geoserver doesn't have the ability to create offset
> lines, so there's no nice way to do this without doing a little
> negative buffer on the shape (which incidentally, you could do using
> the geometry transformation facility on the fly
> http://docs.geoserver.org/stable/en/user/styling/sld-extensions/geometry-transformations.html
>
> P
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <StyledLayerDescriptor version="1.0.0"
> xmlns="http://www.opengis.net/sld"
> xmlns:ogc="http://www.opengis.net/ogc"
>   xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:gml="http://www.opengis.net/gml"
>   xsi:schemaLocation="http://www.opengis.net/sld
> http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
>   <NamedLayer>
>     <Name>USA states</Name>
>     <UserStyle>      <Name>population</Name>
>       <Title>United States</Title>
>       <Abstract>A Simple Brush Style</Abstract>
>       <FeatureTypeStyle>
>       <Rule>
>       <LineSymbolizer>
>         <Stroke>
>         <GraphicStroke>
>           <Graphic>
>           <ExternalGraphic>
>             <OnlineResource xlink:type="simple"
> xlink:href="file:///Users/pramsey/green_bottom.gif" />
>             <Format>image/gif</Format>
>           </ExternalGraphic>
>           </Graphic>
>           </GraphicStroke>
>         <CssParameter name="stroke-linecap">round</CssParameter>
>         <CssParameter name="stroke-dasharray">1 0 1 0</CssParameter>
>         </Stroke>
>       </LineSymbolizer>
>     </Rule>
>     </FeatureTypeStyle>
>     </UserStyle>
>     </NamedLayer>
> </StyledLayerDescriptor>
>
>
> On Tue, Feb 28, 2012 at 12:00 PM, Robert Buckley
> <robertdbuckley at yahoo.com> wrote:
>> Thanks for the advice.
>>
>> Unfortunately I don´t understand what you have just told me....half-brush?
>> half-circle?
>>
>> are these sld specifications?...I am delivering wms data using sld´s to
>> style the data.
>>
>> could you please clarify?
>>
>> cheers,
>>
>> Rob
>>
>> ________________________________
>> Von: Paul Ramsey <pramsey at opengeo.org>
>> An: Robert Buckley <robertdbuckley at yahoo.com>; PostGIS Users Discussion
>> <postgis-users at postgis.refractions.net>
>> Gesendet: 19:20 Dienstag, 28.Februar 2012
>> Betreff: Re: [postgis-users] how to create a hole in a polygon table?
>>
>> Rather than geometry processing, work on your rendering engine. You
>> can usually achieve an interior band (the classic National Geographic
>> political boundary, yes?) with a half-brush (rather than a full
>> circle, use a half-circle), and just ensuring your polygons are
>> consistently oriented.
>>
>> P.
>>
>> On Tue, Feb 28, 2012 at 10:04 AM, Robert Buckley
>> <robertdbuckley at yahoo.com> wrote:
>>> Hi,
>>>
>>> I am trying to create an inner buffer of a polygon geometry table.
>>> Unfortunately this is the only way I can think of which will enable me to
>>> make a certain symbol for a polyon layer. The SLD Filter "difference"
>>> might
>>> do it, but it needs to be nested and i´m not sure if this is possible.
>>>
>>> anyway....My polygons need to be symbolized with a thin outline AND an
>>> inside Buffer of 3 mm(150m  at a scale of 1:50 000)....in essence just an
>>> inside ring.
>>>
>>> This means I need to first buffer my polygon geometry and then substract
>>> the
>>> buffer from the original polygon. = ST_Difference (i think!?!)
>>>
>>> my attempt created some geometries but not what I was expecting...
>>>
>>> create view rrop08.rrop_01_13_innerbuffer AS
>>>
>>> SELECT ST_Difference(a.st_buffer, b.the_geom)
>>>
>>> FROM rrop08.rrop_01_13_buffer a, rrop08.rrop_01_f b;
>>>
>>>
>>> rrop08.rrop_01_f  = the original polyon
>>>
>>> rrop08.rrop_01_13_buffer = the inner buffer
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list