Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Archive for February, 2011

Geometry Collections and Small Headaches (pics)

Posted by smathermather on February 10, 2011

Posted in Database, GeoServer, PostGIS, SQL | Tagged: , , , , | Leave a Comment »

Geometry Collections and Small Headaches

Posted by smathermather on February 10, 2011

The disk that held the personal geodatabases of our contour datasets died a while back, but not before I loaded the contours into PostGIS and started serving them up. Our new intern is working on putting together some shapefiles layer groups in ArcGIS for map production, and asked for a missing one… . I don’t have it, but in principle can always extract it from PostGIS and serve it back as a shapefile.

So I performed an intersection:


CREATE TABLE public.contour_2_cut AS
	SELECT contour.elevation, (ST_Intersection(contour.the_geom), cutline) AS the_geom, gid FROM
		public.contour_2 AS contour,  (ST_GeomFromText('POLYGON((2000000 860000, 2500000 860000, 2500000 460000, 2000000 460000,2000000 860000))', 3734)) AS cutline;

After adding a primary key:


ALTER TABLE public.contour_2_cut ADD PRIMARY KEY (gid);

I couldn’t display it in uDig, which complained that it was a geometry collection. Ah, of course. In the ESRI world (whence I hark) an intersection takes the form of the least of the geometries involved, so the intersection of a polyline and a polygon is a polyline. Not so in PostGIS. PostGIS supports geometry collections, so naturally the intersection includes both types of geometry. (Side note– the viewing in uDig didn’t fail until it got to the polygon– it first loaded all the contour polylines, then discovering the polygon, threw an error).

What to do? Well, I hoped pgsql2shp would bail me out:


pgsql2shp -f contours_block_08_01 -h cmac-srv-gis -u postgres CM public.contour_2_cut
Initializing... type 'GEOMETRYCOLLECTION' is not Supported at this time.
The DBF file will be created but not the shx or shp files.
You've found a bug! (pgsql2shp.c:2864)

But it doesn’t support GEOMETRYCOLLECTIONs either.

Time to dig deeper. So how do we tell what a geometry is?


SELECT ST_GeometryType(st_geom) FROM contour_2_cut;

and I see ST_LineString is the descriptor for our lines. So, let’s create a copy of the table with just linestrings (we could remove records from the existing table as well):


CREATE TABLE contour_2_cut_line AS
	SELECT * FROM contour_2_cut WHERE
		ST_GeometryType(the_geom) ='ST_LineString';

Posted in Database, PostGIS, SQL | Tagged: , , , , | 5 Comments »

GeoServer Optimization

Posted by smathermather on February 5, 2011

As we move away from a simple stack of PostGIS/GeoServer/GeoWebCache/Openlayers to wrapping a MapFish print service into the stack, it’s time to think more seriously about optimizing and stabilizing GeoServer.

In preparation for this step, I’ve been setting up a series of VMWare ESX-hosted Debian Linux VMs to function as the cluster of geospatial services.

Fortunately for me, there’s plenty of great advice in Andre Aime’s 2009 Foss4G presentation GeoServer in Production. Here’s what I gleaned from the presentation (any mistakes are undoubtedly mine and not Aime’s), plus a little bit of expansion from me:

1) Control the requests coming into the system. In this case, Andre talks about application container requests, limiting, e.g. Tomcat concurrent requests to 20 instead of the default 200:

maxThreads="20" minSpareThreads="20"

2) Set up a high availability (HA) cluster. There are lots of ways to skin this beast, but a cheap and easy way is via the Ultimate Cheapskate Cluster. In Aime’s presentation, this is using vrrpd + balance, but with the current option of using “Pen“, stateful protocols like WFS-Transactional should be supported in addition to WMS.

3) Set up your java virtual machines intelligently. Most of this information get’s covered in GeoServer’s documentation page Running in a Production Environment. Additions from Andre’s presentation which might still be relevant are the following JVM flags:

-XX:NewRatio=2
-XX:+AggressiveOpt

If you use the second one, the JVM will use experimental optimizations, so test for stability before using this in a production environment.  The first one notifies the virtual machine that there will be many temporary objects.

(FYI, for the nubes like me out there– JVM flags for Tomcat are set in the Catalina.sh startup script.)

3a) This get’s a special subheading, ’cause I couldn’t figure out why my WMS rendering was slow and unstable when I switched from Windows to Linux: Install and Use JAI & JAI Image I/O.

4) Finally, make sure your data are structured properly. If it’s really big imagery (>2GB), use an Image Pyramid, but otherwise, take advantage of internal tiling and overviews.  Examples from gdal’s utilities include
gdal_translate -of GTiff -co "TILED=YES" utm.tif utm_tiled.tif
which creates internal tiling, and

gdaladdo -r average utm_tiled.tif 2 4 8 16 32 64 128 256

which adds overviews.  You might also look to optimize the size of internal tiling.

For vector data, use PostGIS (not shapefiles), and index on your geometry and any attributes that are used in your SLD as filters. Also, show simple symbology when “zoomed out”, and reserve the complex rules for closer zoom levels.

An alternative that Aime doesn’t mention is that for really complicated data, you can do additional optimization. You can create generalized geometry columns as alternate columns. This is the vector equivalent of overviews. The SLD can then be coded to use the alternate simplified geometry at coarser scales (see e.g. this post for info on how to specify the geometry column in an SLD).  I wish I could find the GeoServer post that originally advocated this technique… .

Hopefully this helps stabilize, optimize, and increase the availability of your GeoServer instance.  Hopefully it does so for mine as well… .

Posted in GeoServer | Tagged: , , , , , , , , | 4 Comments »

Parcel Annotations in GeoServer (with some Maplex help) (cont. 2)

Posted by smathermather on February 4, 2011

I promised pics from our labeled parcels:

 

https://smathermather.wordpress.com/2011/02/01/parcel-annotations-in-geoserver-with-some-maplex-help/

https://smathermather.wordpress.com/2011/02/01/parcel-annotations-in-geoserver-with-some-maplex-help-cont-1/

Posted in GeoServer, PostGIS | Tagged: , , , , , , , , | Leave a Comment »

Landscape Position and McNab Indices (cont.2)

Posted by smathermather on February 1, 2011

In one and two previous posts, I talked about McNab indices and what they mean and how to compute them.  This is a short post just showing another screenshot of a McNab mesoscale.  The previous image was from a stream valley running through the glaciated Allegheny Plateau.  This image is a stream cut through the soft shale of the Lake Plain of the Eastern Basin of Lake Erie:

 

Posted in Landscape Position | Leave a Comment »

Parcel Annotations in GeoServer (with some Maplex help) (cont. 1)

Posted by smathermather on February 1, 2011

See the previous post for an explanation, but here's the SLD we used for parcel labeling.  Now remember-- we got
those rotation values from Maplex, so this isn't a pure use of SLDs, but boy is it a long one anyway:

<?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"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>Parcels Annotation</Name>
    <UserStyle>
    <Title>Parcels Annotation</Title>
    <Abstract>Symbolization for labelling of parcels</Abstract>
      <FeatureTypeStyle>

                   <Rule>
        <Name>rule1</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>res_prop</ogc:PropertyName>
                                <ogc:Literal>Y</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>20</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>32001</MinScaleDenominator>
          <MaxScaleDenominator>64000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>10.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                           <Rule>
        <Name>rule2</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>res_prop</ogc:PropertyName>
                                <ogc:Literal>N</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>20</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>18001</MinScaleDenominator>
          <MaxScaleDenominator>64000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>10.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                           <Rule>
        <Name>rule3</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>res_prop</ogc:PropertyName>
                                <ogc:Literal>Y</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>10.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>20.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>18001</MinScaleDenominator>
          <MaxScaleDenominator>64000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>8.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                          <Rule>
        <Name>rule4</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsEqualTo>
                                <ogc:PropertyName>res_prop</ogc:PropertyName>
                                <ogc:Literal>Y</ogc:Literal>
                            </ogc:PropertyIsEqualTo>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>50.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>10.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>18001</MinScaleDenominator>
          <MaxScaleDenominator>64000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>6.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                   <Rule>
        <Name>rule5</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                          <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>20</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                    </ogc:Filter>

          <MinScaleDenominator>12001</MinScaleDenominator>
          <MaxScaleDenominator>18000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>12.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                   <Rule>
        <Name>rule6</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>10.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>20.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>12001</MinScaleDenominator>
          <MaxScaleDenominator>18000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>10.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                           <Rule>
        <Name>rule7</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>3</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>10</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>12001</MinScaleDenominator>
          <MaxScaleDenominator>18000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>8.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>
        <Rule>
                <Name>rule8</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>3</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>12001</MinScaleDenominator>
          <MaxScaleDenominator>18000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>6.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                <Rule>
                <Name>rule9</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>0.5</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>12001</MinScaleDenominator>
          <MaxScaleDenominator>18000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>4.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                          <Rule>
        <Name>rule10</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                          <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>5</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                    </ogc:Filter>

          <MinScaleDenominator>9001</MinScaleDenominator>
          <MaxScaleDenominator>12000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>12.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                        <Rule>
                <Name>rule11</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>5.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>10</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>9001</MinScaleDenominator>
          <MaxScaleDenominator>12000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>10.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                                <Rule>
                <Name>rule12</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>2.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>5</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>9001</MinScaleDenominator>
          <MaxScaleDenominator>12000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>8.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                                        <Rule>
                <Name>rule13</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>2</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>9001</MinScaleDenominator>
          <MaxScaleDenominator>12000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>6.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

        <Rule>
                        <Name>rule15</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>0.5</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>9001</MinScaleDenominator>
          <MaxScaleDenominator>12000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>4.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                   <Rule>
        <Name>rule16</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                   <ogc:Filter>
                          <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>2</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                    </ogc:Filter>

          <MinScaleDenominator>4201</MinScaleDenominator>
          <MaxScaleDenominator>9000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>16.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                   <Rule>
        <Name>rule17</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1.0</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>2.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>4201</MinScaleDenominator>
          <MaxScaleDenominator>9000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>10.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                           <Rule>
        <Name>rule18</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>0.5</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>1.0</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>4201</MinScaleDenominator>
          <MaxScaleDenominator>9000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>8.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>
        <Rule>
                <Name>rule19</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

                    <ogc:Filter>
                        <ogc:And>
                            <ogc:PropertyIsGreaterThanOrEqualTo>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>0.3</ogc:Literal>
                            </ogc:PropertyIsGreaterThanOrEqualTo>
                            <ogc:PropertyIsLessThan>
                                <ogc:PropertyName>acreage</ogc:PropertyName>
                                <ogc:Literal>0.5</ogc:Literal>
                            </ogc:PropertyIsLessThan>
                        </ogc:And>
                    </ogc:Filter>

          <MinScaleDenominator>4201</MinScaleDenominator>
          <MaxScaleDenominator>9000</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>6.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

                <Rule>
                <Name>rule20</Name>
      	<Title>Parcels</Title>
      	<Abstract>Symbolization: Parcels zoomed-out</Abstract>

          <MaxScaleDenominator>4200</MaxScaleDenominator>

                                        <TextSymbolizer>
                        <Label>
                            <ogc:PropertyName>textstring</ogc:PropertyName>
                        </Label>
                        <Font>
                            <CssParameter name="font-family">
                                <ogc:Literal>Calibri</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-size">
                                 <ogc:Literal>14.0</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-style">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="font-weight">
                                <ogc:Literal>normal</ogc:Literal>
                            </CssParameter>
                        </Font>
                        <LabelPlacement>
                            <PointPlacement>
                                <AnchorPoint>
                                    <AnchorPointX>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointX>
                                    <AnchorPointY>
                                        <ogc:Literal>0.5</ogc:Literal>
                                    </AnchorPointY>
                                </AnchorPoint>
                                <Displacement>
                                    <DisplacementX>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementX>
                                    <DisplacementY>
                                        <ogc:Literal>0</ogc:Literal>
                                    </DisplacementY>
                                </Displacement>
                               <Rotation>
                                      <ogc:PropertyName>rot_ang</ogc:PropertyName>
                                </Rotation>
                            </PointPlacement>
                        </LabelPlacement>

            		<Halo>
                		<Radius>
			                 <ogc:Literal>0</ogc:Literal>
	        	        </Radius>
        	        	<Fill>
			                <CssParameter name="fill">#000000</CssParameter>
			                <CssParameter name="fill-opacity">0.0</CssParameter>
		                </Fill>
		        </Halo>

                        <Fill>
                            <CssParameter name="fill">
                                <ogc:Literal>#000000</ogc:Literal>
                            </CssParameter>
                            <CssParameter name="fill-opacity">
                                <ogc:Literal>1.0</ogc:Literal>
                            </CssParameter>
                        </Fill>
                        <VendorOption name="repeat">1000</VendorOption>
                        <VendorOption name="goodnessOfFit">0.95</VendorOption>

                    </TextSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Posted in GeoServer, PostGIS | 1 Comment »

Parcel Annotations in GeoServer (with some Maplex help)

Posted by smathermather on February 1, 2011

smathermather:

We have a guest blogger today– Ramon, a bright and hard-working intern I’ve had the pleasure of working with for over a year.  If you’re looking for someone versed in Postgre/PostGIS/GeoServer/OpenLayers, Ramon’s been my rock as we’ve been building our internal system, doing everything from basic grunt work to esoteric trouble-shooting.  I’m trying hard not to fall on my face now that he’s moved on.

We wanted to take advantage of the advance labeling of Maplex for parcels in GeoServer.  GeoServer SLDs don’t yet (I think) have automatic rotation for best fit for polygons, but Maplex (an ESRI label extension that’s rolled in with the ArcINFO license in ArcGIS desktop) does.  Here’s how we took advantage of that:

Ramon:
The general procedure to generate the attribute table is as follows: (Note: It is best to do this in sections because in the limitations of labels that could be generated per annotation feature)
1) Generate the labels using Maplex as the label engine in Arcmap.
2) Convert the labels into annotation (in a database)
3) Join the annotation table back to the original polygon that needs labeled.
4) Export the dataset to create a new shapefile with the combined attribute table of the original shapefile and “annotation feature”
5) Import the shapefile to PostgreSQL

Notes: I added the following fields to the shapefie before importing it to PostgreSQL
a) acreage – area of the parcel in acres
b) res_prop – “Y” if parcel is within 1500 ft of our area of interest, otherwise “N”
c) ang – small integer conversion of the “Angle” value generated by Maplex (this may be scrapped from the workflow in the future)
d) Rot_Ang – the rotation angle in terms of Geoserver convention.
– calculated as “zero” minus “ang” (see the UPDATE SQL below)
e.g. UPDATE base.parcel_annotations_med SET rot_ang = 0 – ang;

smathermather:

This final step step converts annotation rotation values, which are rotated from horizontal up to 90 degrees either in a positive or negative to GeoServer label rotation convention, which run the full arc of a circle.

We’ll have a post that follows with the final SLD, and screen shot of the great labeling effect.  Stay posted.

Posted in GeoServer, PostGIS | Tagged: , , , , , , , , | 2 Comments »