From: Budschedl H. <Har...@ik...> - 2012-10-24 10:57:12
|
Hi again! Got it solved. Other then documented, the 0° origin of the compass is the same in all the systems. But Geoserver just rotates clockwise while other systems rotate counter clockwise. So y= 360 - x does the trick. BTW, the errormessage was because of a case-sensitivity problem with the fieldname in the SLD file. "Validate" didn't find that (because it probably doesn't check the fieldnames against the database of the source data). So always be sure, that any fieldname you put between the <ogc> tags is in the same case as the fielddefinition of the source database... Everything solved now. Thx@Edward again. Harry Von: Edward Mac Gillavry [mailto:ema...@ho...] Gesendet: Mittwoch, 24. Oktober 2012 12:45 An: Budschedl Harald; geo...@li... Betreff: RE: [Geoserver-users] Hello to the list and first question aboutlabel rotation Harald, Everytime, text rotation does my head in... Indeed, QGIS and GeoServer take different approaches to handling what's 0 degrees or what's 90 degrees. If you would like text to appear almost upright, then the ORIENTATION value appears the promising one. Simply open the file you have to download as this may contain the error message due to some overzealous replacement regex upon modifying the SLD? You'll be able to awe your colleagues soon, just hang on a little longer ;-) Kind regards, Edward ________________________________ From: Har...@ik... To: geo...@li... Date: Wed, 24 Oct 2012 12:27:44 +0200 Subject: Re: [Geoserver-users] Hello to the list and first question about label rotation Hi Edward Thanks for your reply The change made the text stand in the right place now. Sadly, the rotation is still wrong. Example: One of the labels, which is supposed to stand nearly upright has following angles saved in the attribute: ORIENTATION: 1.39718 GSROTATION: 88.60282 In QGIS and Geomedia the label stands upright. In Geoserver the label stands tilted to the right. Just for fun, I changed back the rotation clause to the ORIENTATION field. Now it doesn't load at all anymore but instead I get a file download dialog telling me that "wms" is an unknown mime type... Something seems seriously wrong here... Harry. Von: Edward Mac Gillavry [mailto:ema...@ho...] Gesendet: Mittwoch, 24. Oktober 2012 11:43 An: Budschedl Harald; geo...@li... Betreff: RE: [Geoserver-users] Hello to the list and first question aboutlabel rotation Hi Harald, Check out the part <AnchorPoint> <AnchorPointX>0.0</AnchorPointX> <AnchorPointY>0.0</AnchorPointY> </AnchorPoint> If you adjust the value to 0.5, it will take the centre of the text instead. Kind regards, Edward ________________________________ From: Har...@ik... To: geo...@li... Date: Wed, 24 Oct 2012 11:15:54 +0200 Subject: [Geoserver-users] Hello to the list and first question about label rotation Hi folks Being new, first I want to greet everyone on the list. English ain't my mother tongue so I hope you are patient with me :) I am Harry and am working for the IT of a public company in Austria. We are mainly working with Intergraph software, managing data in many different formats. But I am always trying to keep an open mind towards the open source world. At the moment I am trying to build an alternative infrastructure consisting a PostGIS database and a Geoserver. I use FME to migrate some data (for testing) into the PostGIS database. Then I try to create WMS, WFS and later WMTS services via Geoserver. The process goes quite well, with the usual bumps and hickups. Now I am running into a problem with labeling. My data contains textobjects, being saved as points, having a text and a rotation angle written into an attribute. The problem is the rotation of the text. The rotation angle saved in the attribute ORIENTATION is the exact angle of the Text as it was created in GeoMedia. There, 0° is East and the rotation is counter clockwise. This kind of rotation works in Autodesk products and even in Quantum GIS. Sadly, Geoserver goes a different way and has 0° in the North, rotating clockwise. With the help of my sister (she is a math teacher, yea, that helps :D ) I found the right algorithm for translating the degrees: For angles between 0 to 90 degrees: y = 180 - (x + 90) For all the other angles: y = 180 - (x + 90) + 360 X being the original geomedia-angle stored in the field "ORIENTATION", Y being the translated angle for GeoServer, which I stored in a field "GSROTATION". No problems for FME, using AttributeFieldMapper and ExpressionEvaluator. The numbers in PostGIS check out. I then created a style file which looks as follows: <?xml version="1.0" encoding="UTF-8"?> <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" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd<http://www.opengis.net/sld%20http:/schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd>"> <NamedLayer> <Name>Strassenbahnbeschriftung</Name> <UserStyle> <Name>Strassenbahnbeschriftung</Name> <FeatureTypeStyle> <Rule> <Name>Single symbol</Name> <!-- MaxScaleDenominator>5000</MaxScaleDenominator --> <PointSymbolizer> <Graphic> <Mark> <WellKnownName>circle</WellKnownName> </Mark> <Size>0</Size> </Graphic> </PointSymbolizer> <TextSymbolizer> <Label> <ogc:PropertyName>textstring</ogc:PropertyName> </Label> <Font> <CssParameter name="font-family">Arial</CssParameter> <CssParameter name="font-size">12</CssParameter> <CssParameter name="font-style">normal</CssParameter> <CssParameter name="font-weight">bold</CssParameter> </Font> <LabelPlacement> <PointPlacement> <AnchorPoint> <AnchorPointX>0.0</AnchorPointX> <AnchorPointY>0.0</AnchorPointY> </AnchorPoint> <Displacement> <DisplacementX>0</DisplacementX> <DisplacementY>0</DisplacementY> </Displacement> <Rotation> <ogc:PropertyName>gsrotation</ogc:PropertyName> </Rotation> </PointPlacement> </LabelPlacement> <Fill> <CssParameter name="fill">#781760</CssParameter> </Fill> </TextSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor> The style is valid, I can add it to the layer and can preview the Layer in Geoserver. Sadly, the orientation of the text is all wrong. I tried a few things, compared the results to the original data and it seems, that instead of rotating around the center of the text, the whole thing rotates around some of the corner points of the MBR of the text or so. The beaviour is very strange, to say the least... So after much testing (and coursing) I decided to ask the community. I sincerely hope you can help me. TIA for any hints. Regards, Harry Freundliche Grüße Harald Budschedl Geodaten Management (Geo) IKT Linz GmbH Ein Unternehmen der Stadt Linz 4040 Linz, Hauptstraße 1-5 AUSTRIA Tel. +43 732 7070 4787 Fax +43 732 7070 54 4787 visit www.linz.at/ikt<http://www.linz.at/ikt> mailto: har...@ik...<mailto:ger...@ik...> ________________________________ Diese Nachricht inklusive aller Anhänge kann vertrauliche Informationen enthalten. Sie ist ausschließlich für die adressierten Personen bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe sind nicht gestattet. Sollten Sie nicht die richtige Adressatin/der richtige Adressat sein, vernichten Sie den gesamten Inhalt (§ 93 Abs. 4 Telekommunikationsgesetz 2003) und informieren Sie bitte sofort den/die Absender/in. Nähere Regelungen zur elektronischen Kommunikation mit der Stadt Linz finden Sie in den "Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend das E-Government der Stadt Linz (e-linz)" ( http://www.linz.at/images/AGB_egov_2008.pdf ) IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344 IKT Linz Infrastruktur GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321990s ++ UID-Nummer: ATU64664303 A-4020 Linz, Gruberstraße 42, Tel. +43 732 7070 0, Fax: +43 732 7070 4704, of...@ik...<mailto:of...@ik...>, www.linz.at/ikt<http://www.linz.at/ikt> ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Geoserver-users mailing list Geo...@li...<mailto:Geo...@li...> https://lists.sourceforge.net/lists/listinfo/geoserver-users ________________________________ Diese Nachricht inklusive aller Anhänge kann vertrauliche Informationen enthalten. Sie ist ausschließlich für die adressierten Personen bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe sind nicht gestattet. Sollten Sie nicht die richtige Adressatin/der richtige Adressat sein, vernichten Sie den gesamten Inhalt (§ 93 Abs. 4 Telekommunikationsgesetz 2003) und informieren Sie bitte sofort den/die Absender/in. Nähere Regelungen zur elektronischen Kommunikation mit der Stadt Linz finden Sie in den "Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend das E-Government der Stadt Linz (e-linz)" ( http://www.linz.at/images/AGB_egov_2008.pdf ) IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344 IKT Linz Infrastruktur GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321990s ++ UID-Nummer: ATU64664303 A-4020 Linz, Gruberstraße 42, Tel. +43 732 7070 0, Fax: +43 732 7070 4704, of...@ik...<mailto:of...@ik...>, www.linz.at/ikt<http://www.linz.at/ikt> ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Geoserver-users mailing list Geo...@li...<mailto:Geo...@li...> https://lists.sourceforge.net/lists/listinfo/geoserver-users ________________________________ Diese Nachricht inklusive aller Anhänge kann vertrauliche Informationen enthalten. Sie ist ausschließlich für die adressierten Personen bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe sind nicht gestattet. Sollten Sie nicht die richtige Adressatin/der richtige Adressat sein, vernichten Sie den gesamten Inhalt (§ 93 Abs. 4 Telekommunikationsgesetz 2003) und informieren Sie bitte sofort den/die Absender/in. Nähere Regelungen zur elektronischen Kommunikation mit der Stadt Linz finden Sie in den "Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend das E-Government der Stadt Linz (e-linz)" ( http://www.linz.at/images/AGB_egov_2008.pdf ) IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344 IKT Linz Infrastruktur GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321990s ++ UID-Nummer: ATU64664303 A-4020 Linz, Gruberstraße 42, Tel. +43 732 7070 0, Fax: +43 732 7070 4704, of...@ik..., www.linz.at/ikt |