osggis中重新投影数据

osggis中重新投影数据有两种方式:1通过TransformFilter类来做,TransformFilter继承于Filter类·;2,在代码中设置投影信息

第一种方法,比较简单,用到osggis封装的类;代码如下:

<graph name="streets">

       <filter type="Transform">

                <property name="use-terrain-srs" value="true"/>

                <property name="localize" value="true"/>

        </filter>

.</graph>

第二种方法比较繁琐,设计比较底层:

<!-- Define an SRS based on an OSG WKT description: -->
<resource type="srs" name="wgs84">
    GEOGCS["WGS84",DATUM["WGS_1984",SPHEROID["WGS84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9108"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4326"]]
</resource>

<!-- A simple filter graph for transforming data into WGS84: -->
<graph name="to wgs84">
    <filter type="Transform">
        <property name="srs" value="'wgs84'"/>
    </filter>
</graph>

<!-- The original feature layer, in UTM: -->
<source name="streets.utm">
    <uri>data/streets-utm.shp</uri>
</source>

<!-- Our new, intermediate feature layer, in WGS4, along with instructions on building it: -->
<source name="streets.wgs84" parent="streets.utm" graph="to wgs84">
    <uri>data/streets-wgs84.shp</uri>
</source>

<!-- The main filter graph for assembling the 3D geometry: -->
<graph name="streets">
    <filter type="BuildGeom"/>
    <filter type="Collect"/>
    <filter type="BuildNodes"/>
</graph>

<!-- The layer target: -->
<layer name="streets" source="streets.wgs84" target="out/streets.ive">
    <slice min_range="0" max_range="1e6" graph="streets"/>
</layer>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值