วันอาทิตย์ที่ 27 มีนาคม พ.ศ. 2559

How to Calculate the Area of Polygon in ArcMap

First, open up an ArcGIS session and load in the polygon data you want to calculate the area on.  Make sure your data is in a projection system.
Next, select the polygon file that you want to calculate area on and right click.  This will open up a menu of options for that layer.  Select the “Open Attribute Table” to open up the associate attribute data for your polygon layer.
right-click-gis-file
In the upper left hand corner of the attribute table window, click on the Table Options icon to open up the menu options.  Select the “add field” option.
add-field-gis-table
When the “add field” dialogue box appears, type in the name of the field that will store the area values (e.g. name it “area”).  Select “double” as the field type.  Next, set your precision and scale values. Precision is the total number of digits that can be stored in the field, counting on both sides of the decimal place. A precision of 3 means that there can be at maximum number of digits can be 3.  Scale for floating and double fields is the number of digits to the right of the decimal place.  It is always better to overestimate the fields to avoid truncation of your values.  Enter your values and hit the “OK” button to add the new field.
add-field-gui
Right click on the new field and select the “calculate geometry” option on the menu. Click “Yes” to move past the editing session warning that pops up.
calculate-geometry
If you are working in a geographic coordinate system, you will not be able to calculate geometry.  The calculate area and perimeter options will be disabled. ArcGIS uses planimetric algorithms to calculate geometry such as area and perimeter.
geographic-coordinate-area-disabledTo be able to calculate area, you will need to work with projected GIS data.  There are two ways to do this: either load in projected data or load the data into a data frame that has a projected coordinate system (PCS) assigned to it. To set a PCS on a data frame, right click on the layer icon and select “properties” from the drop down menu.  Then select the “coordinate system” tab and select a coordinate system from the options.
change-coordinate-system-arcgis
Once you have set the requisite PCS, go back to the attribute field, right click on the designated empty area field to re-select the calculate geometry option.  In the “calculate geometry” window, select the “area” option from the drop down menu at the top of the form.  Then select the PCS you want to use in your calculations.  This can either be the PCS for the data layer or the data frame.
Finally, select the units you want the area calculation to be in.  The units available for selection will be compatible with the PCS units.  If you want acreage, make sure your PCS is in feet and then select the acreage option in the drop down for units.
Hit the “OK” button to run the area geometry calculation.
calculate-area-arcgis

The area calculation will then run and your area field will be populated with the area values.

copy from : https://www.gislounge.com/calculating-polygon-area-in-arcmap/

วันพุธที่ 2 มีนาคม พ.ศ. 2559

Labeling on line


update GeoServer2.12 document   2017.11.28

<TextSymbolizer>

   <Label>
      <ogc:PropertyName>RD_NAME</ogc:PropertyName>
      <ogc:Literal><![CDATA[
]]></ogc:Literal>แสดงผลคนละบรรทัด
      <ogc:PropertyName>RD_NAME_EN</ogc:PropertyName>
   </Label>

<![CDATA[]]>  ช่วยในการแสดงชื่อมากกว่า 1 ฟิลด์ สัมพันธ์กับ
<VendorOption name="followLine">false</VendorOption>
ต้องทำให้เป็น disable คำสั่งนี้จึงแสดงผลคนละบรรทัด แต่ label ไม่โค้งตามเส้น หากใช้กับเส้นถนน ก็จะทำให้ชื่อถนนดูไม่สวยงาม

 
   <Font>
      <CssParameter name="font-family">Arial</CssParameter>
      <CssParameter name="font-weight">normal</CssParameter>
      <CssParameter name="font-size">15</CssParameter>
   </Font>


<LabelPlacement> The SLD specification defines two alternative label placement strategies which can be used in the <LabelPlacement> element:
  • <PointPlacement> places labels at a single point 
  • <LinePlacement> places labels along a line 

    <LabelPlacement>
For lines, this point lies at the middle of the visible portion of the line.
       <PointPlacement>
            <AnchorPoint>
               <AnchorPointX>0.5</AnchorPointX>
              <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
            <Displacement>
               <DisplacementX>0</DisplacementX>
               <DisplacementY>0</DisplacementY>
           </Displacement>
       </PointPlacement>        










Displacement of X=10 pixels (compare with default anchor point of (X=0, Y=0.5) shown above)





 Displacement of Y=-10 pixels (compare with anchor point (X= 0.5, Y=1.0) - not shown)



      


       <LinePlacement> 
         <PerpendicularOffset>0</PerpendicularOffset>
       </LinePlacement>                                   
   </LabelPlacement>


<PerpendicularOffset> The optional <PerpendicularOffset> element allows you to position a label above or below a line.

 
PerpendicularOffset = 0 (default) 

PerpendicularOffset = 10

   <Halo>กำหนดขอบ Label
      <Radius>
         <ogc:Literal>1</ogc:Literal>กำหนดรัศมี
      </Radius>
      <Fill>
         <CssParameter name="fill">#FF0000</CssParameter>สีของขอบ
      </Fill>
   </Halo> 
   <Fill>
      <CssParameter name="fill">#000000</CssParameter> แสดงสี Label
   </Fill>

Geoserver Enhanced Options

ให้เลือกอันใดอันหนึ่ง
   <VendorOption name="group">yes</VendorOption>
Lines are joined together, clipped to the view rectangle, and the longest path is used.


    <VendorOption name="labelAllGroup">true</VendorOption>
It causes all of the disjoint paths in a line group to be labeled, not just the longest one.


    <VendorOption name="spaceAround">0</VendorOption>
    <VendorOption name="followLine">true</VendorOption>
It is required to use <LinePlacement> along with this option to ensure that labels are placed along lines:
    <VendorOption name="maxDisplacement">10</VendorOption>
the value should always be lower than the value for repeat.
    <VendorOption name="repeat">100</VendorOption>
  • determines how often GeoServer displays labels along a line
  • Normally GeoServer labels each line only once, regardless of length.
  • Specifying a positive value for this option makes the labeller attempt to draw the label every repeat pixels.
  • For long or complex lines (such as contour lines) this makes labeling more informative.

   <VendorOption name="maxAngleDelta">90</VendorOption>
   <VendorOption name="autoWrap">50</VendorOption>
กำหนดการแสดงความยาวของ label ตาม pixel ไม่ให้ยาวเกินไป
Label อาจมีการ split มากกว่า1บรรทัด ตามความยาว pixel ที่กำหนด
<VendorOption name="forceLeftToRight">false</VendorOption>

<VendorOption name="conflictResolution">false</VendorOption>

<VendorOption name="goodnessOfFit">0.3</VendorOption>

<VendorOption name="graphic-resize">stretch</VendorOption>

<VendorOption name="graphic-margin">margin</VendorOption>

<VendorOption name="partials">true</VendorOption>

<VendorOption name="underlineText">true</VendorOption>

<VendorOption name="strikethroughText">true</VendorOption>

<VendorOption name="charSpacing">3</VendorOption>

<VendorOption name="wordSpacing">5</VendorOption>


</TextSymbolizer>