Skip to content

Commit

Permalink
Add mapscript map loading script
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika committed Mar 28, 2019
1 parent 80c5929 commit 9b5d845
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mappyfile.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
<OutputPath>.</OutputPath>
<Name>mappyfile</Name>
<RootNamespace>mappyfile</RootNamespace>
<InterpreterId>MSBuild|mappyfile3|$(MSBuildProjectFullPath)</InterpreterId>
<InterpreterId>MSBuild|mappyfile|$(MSBuildProjectFullPath)</InterpreterId>
<StartupFile>tests\test_comments.py</StartupFile>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<Environment>PATH=C:\MapServer\bin;%PATH%
PROJ_LIB=C:\MapServer\bin\proj\SHARE
</Environment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -172,6 +177,9 @@
<Content Include="mappyfile\schemas\rgb.json" />
<Content Include="mappyfile\schemas\layer.json" />
<Content Include="mappyfile\schemas\map.json" />
<Content Include="misc\mapscript_test.py">
<SubType>Code</SubType>
</Content>
<Content Include="misc\shapefile_layer.map">
<SubType>Code</SubType>
</Content>
Expand Down
21 changes: 21 additions & 0 deletions misc/mapscript_loading.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
C:\VirtualEnvs\mappyfile\Scripts\activate
SET PATH=C:\MapServer\bin;%PATH%
SET PROJ_LIB=C:\MapServer\bin\proj\SHARE
"""
import mapscript
s = u"""
MAP
LAYER
TYPE POINT
CLUSTER
MAXDISTANCE 50
REGION ELLIPSE
END
END
END
"""

map = mapscript.fromstring(s)

print(map.convertToString())

0 comments on commit 9b5d845

Please sign in to comment.