|
From: Jody G. <jod...@gm...> - 2024-08-20 03:18:31
|
There is a tutorial on how to make a function here: https://docs.geotools.org/stable/userguide/tutorial/function.html The example shows how to process a geometry (a point in this case). The geometry object has a geometry.reverse() method that can be used to change the order from clockwise to counter clockwise. Looks like there is a method here to force geometry to CCW: https://javadoc.io/doc/org.locationtech.jts.io/jts-io-common/1.18.1/org/locationtech/jts/io/geojson/OrientationTransformer.html It would be a useful function to add to GeoTools! - - Jody Garnett On Mon, Aug 19, 2024 at 6:02 PM Humphries, Graham via Geoserver-users < geo...@li...> wrote: > A line does not have an inside. > > You need to ensure your lines are drawn in the same direction ie: > clockwise or anti clockwise you could offset from the line to the “inside” > > Alternatively, you could create a polygon and then use a spatial operation > to determine where the inside is. > > > > I don’t think it is a trivial task. > > > > Regards, > > Graham Humphries > > > > *From:* Fernando Quadro <fsq...@gm...> > *Sent:* Tuesday, August 20, 2024 7:06 AM > *To:* Ian Turton <ijt...@gm...> > *Cc:* geoserver-users <geo...@li...> > *Subject:* Re: [Geoserver-users] SLD for lots > > > > Ian, > > > Yes, it is a line, and how can I invent it so that the information stays > on the "inside"? > > > > Best regards, > > > Fernando Quadro > http://www.fernandoquadro.com.br > https://www.linkedin.com/in/fernandoquadro/ > > > > > > Em qui., 15 de ago. de 2024 às 06:02, Ian Turton <ijt...@gm...> > escreveu: > > If they are lines then you need to reverse the ones where they are on the > "wrong" side > > > > Ian > > > > On Wed, 14 Aug 2024 at 23:03, Jody Garnett <jod...@gm...> wrote: > > I wonder if you can do a label offset with a negative offset. You then > need to ensure the polygons all wind CW. Or positive offset with CCW > winding. > > > > What is your data in? Can you check the geometry? > > - - > > Jody Garnett > > > > > > On Wed, Aug 14, 2024 at 1:10 PM Fernando Quadro <fsq...@gm...> > wrote: > > Hello everyone. I'm creating an SLD for lots and blocks, but I'd like the > measurements to always be within the polygon, and if you notice, some are > outside the polygon. > > > > > > Does anyone know if it's possible to do this, or if it's a limitation? > > The SLD I'm generating is this: > > > > <?xml version="1.0" encoding="UTF-8"?> > <StyledLayerDescriptor xmlns="http://www.opengis.net/sld" version="1.1.0" > xsi:schemaLocation="http://www.opengis.net/sld > http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se=" > http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc=" > http://www.opengis.net/ogc"> > <NamedLayer> > <se:Name>geo_medidalote</se:Name> > <UserStyle> > <se:Name>medidalote</se:Name> > > <se:FeatureTypeStyle> > > <se:Rule> > > > <se:LineSymbolizer> > <se:Stroke> > <se:SvgParameter name="stroke">#000000</se:SvgParameter> > <se:SvgParameter name="stroke-opacity">0</se:SvgParameter> > <se:SvgParameter name="stroke-width">1</se:SvgParameter> > <se:SvgParameter > name="stroke-linejoin">bevel</se:SvgParameter> > <se:SvgParameter > name="stroke-linecap">square</se:SvgParameter> > </se:Stroke> > > </se:LineSymbolizer> > > </se:Rule> > > <se:Rule> > > <MaxScaleDenominator>8000</MaxScaleDenominator> > > <se:TextSymbolizer> > > <se:Label> > <ogc:PropertyName>comprimento</ogc:PropertyName> > </se:Label> > > <se:Font> > <se:SvgParameter name="font-family">Arial</se:SvgParameter> > <se:SvgParameter name="font-size">8</se:SvgParameter> > </se:Font> > > <se:LabelPlacement> > > <se:LinePlacement> > > <se:PerpendicularOffset>10</se:PerpendicularOffset> > <se:GeneralizeLine>true</se:GeneralizeLine> > </se:LinePlacement> > > <VendorOption name="forceLeftToRight">false</VendorOption> > > </se:LabelPlacement> > > <se:Fill> > <se:SvgParameter name="fill">#323232</se:SvgParameter> > </se:Fill> > > </se:TextSymbolizer> > > </se:Rule> > > </se:FeatureTypeStyle> > </UserStyle> > </NamedLayer> > </StyledLayerDescriptor> > > > > Best regards, > > > Fernando Quadro > http://www.fernandoquadro.com.br > https://www.linkedin.com/in/fernandoquadro/ > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoserver-users > > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoserver-users > > > > -- > > Ian Turton > > > ------------------------------ > > CONFIDENTIALITY NOTICE AND DISCLAIMER > The information in this transmission may be confidential and/or protected > by legal professional privilege, and is intended only for the person or > persons to whom it is addressed. If you are not such a person, you are > warned that any disclosure, copying or dissemination of the information is > unauthorised. If you have received the transmission in error, please > immediately contact this office by telephone, fax or email, to inform us of > the error and to enable arrangements to be made for the destruction of the > transmission, or its return at our cost. No liability is accepted for any > unauthorised use of the information contained in this transmission. > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geoserver-users > |