[mapguide-users] Regarding Shape file

sathishpsk9 sathishpsk9 at gmail.com
Wed Jul 22 03:27:01 EDT 2009


Hi kenneth ,
About Shape File loading a have a few more doubts....
1) Upload the file to the desired server folder
   which folder i have to use .... either Pakages folder or
Repositories/Library/DataFile or can i write any folder of my wish 
   I had wrote to D:\Library
2) Create a featuresource xml document (possibly from a template xml file)
3) Set the "filepath" or similar parameter to point to the SHP file that 
was uploaded
 i created features source and  set file path as shown below

    <?xml version="1.0" encoding="utf-8"?>
<FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd">
  <Provider>OSGeo.SHP</Provider>
  <Parameter>
    <Name>DefaultFileLocation</Name>
    <Value>D:\Library\india_st.shp</Value>
  </Parameter>
  <Parameter>
    <Name>TemporaryFileLocation</Name>
    <Value />
  </Parameter>
</FeatureSource>

4) Save the featuresource (likely in the session repo) 
 save it Library://satish/shape.FeatureSource

5) Create a layerdefinition xml document (possibly from a template xml file)
6) Point to the featuresource created in (4)
7) Update the geometry and class info for the featuresource

  created a layer definition and made it point to feature source as shown 

<?xml version="1.0" encoding="utf-8"?>
<LayerDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:noNamespaceSchemaLocation="LayerDefinition-1.1.0.xsd" version="1.1.0">
  <VectorLayerDefinition>
    <ResourceId>Library://satish/shape.FeatureSource</ResourceId>
    <FeatureName>SHP_Schema:shape</FeatureName>
    <FeatureNameType>FeatureClass</FeatureNameType>
    <Filter />
    <PropertyMapping>
      <Name>FeatId</Name>
      <Value>FeatId</Value>
    </PropertyMapping>
    <Geometry>Geometry</Geometry>
    <Url />
    <ToolTip />
    <VectorScaleRange>
      <PointTypeStyle>
        <DisplayAsText>false</DisplayAsText>
        <AllowOverpost>false</AllowOverpost>
        <PointRule>
          <LegendLabel />
          <PointSymbolization2D>
            <Mark>
              <Unit>Points</Unit>
              <SizeContext>DeviceUnits</SizeContext>
              <SizeX>10</SizeX>
              <SizeY>10</SizeY>
              <Rotation>0</Rotation>
              <MaintainAspect>true</MaintainAspect>
              <InsertionPointX>0</InsertionPointX>
              <InsertionPointY>0</InsertionPointY>
              <Shape>Square</Shape>
              <Fill>
                <FillPattern>Solid</FillPattern>
                <ForegroundColor>ff000000</ForegroundColor>
                <BackgroundColor>ffffffff</BackgroundColor>
              </Fill>
              <Edge>
                <LineStyle>Solid</LineStyle>
                <Thickness>1</Thickness>
                <Color>000000</Color>
                <Unit>Points</Unit>
                <SizeContext>DeviceUnits</SizeContext>
              </Edge>
            </Mark>
          </PointSymbolization2D>
        </PointRule>
      </PointTypeStyle>
      <LineTypeStyle>
        <LineRule>
          <LegendLabel />
          <LineSymbolization2D>
            <LineStyle>Solid</LineStyle>
            <Thickness>1</Thickness>
            <Color>000000</Color>
            <Unit>Points</Unit>
            <SizeContext>DeviceUnits</SizeContext>
          </LineSymbolization2D>
        </LineRule>
      </LineTypeStyle>
      <AreaTypeStyle>
        <AreaRule>
          <LegendLabel>ILOT</LegendLabel>
          <AreaSymbolization2D>
            <Fill>
              <FillPattern>Solid</FillPattern>
              <ForegroundColor>ff00ffff</ForegroundColor>
              <BackgroundColor>ffffffff</BackgroundColor>
            </Fill>
            <Stroke>
              <LineStyle>Solid</LineStyle>
              <Thickness>1</Thickness>
              <Color>000000</Color>
              <Unit>Points</Unit>
              <SizeContext>DeviceUnits</SizeContext>
            </Stroke>
          </AreaSymbolization2D>
        </AreaRule>
      </AreaTypeStyle>
    </VectorScaleRange>
  </VectorLayerDefinition>
</LayerDefinition>

8) Save the layerdefinition (likely in the session repo)
  save to Library repository 
  Library://satish/shapelayer.LayerDefinition

9) Add the layer to the runtime map
  added to run time map
 map.GetLayers().Insert(0, mylayer);-- used this method to add

10) Save the runtime map- saved map
11) Refresh the client- refreshed client using layer.ForceRefresh() method .
map not diplayed ..........

Did i followed the steps correctly or i al missing something ?
where does " %MG_DATA_FILE_PATH% "  this point to or indictes ?
Please help  me 


Thanking yoi in anticipation
Satish Kumar




-- 
View this message in context: http://n2.nabble.com/Regarding-Shape--file-tp3270233p3301631.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list