Exemple #1
0
    def transform_bridge(self, srcSRS, midSRS, dstSRS, inpath=None, midpath=None, midlayername=None,
                         outpath=None, outlayername=None, outformat=None,
                         layerCreationOptions=None):
        if inpath is None: inpath = self.in_path
        if outpath is None: outpath = self.out_path
        if outlayername is None: outlayername = self.out_layername
        if outformat is None: outformat = self.out_format
        if layerCreationOptions is None: layerCreationOptions = self.lco

        if midpath is None:
            midpath = os.path.join(os.path.dirname(self.out_path), midlayername)
        midpath = launderLayerName(midpath)

        helmert_para = helmert_para_dict(srcSRS, midSRS)

        [out_path, out_layername] = self.transform_direct(srcSRS, midSRS, inpath=inpath, outpath=midpath,
                                                        outlayername=midlayername, outformat=DataType.geojson,
                                                        helmert_para=helmert_para,
                                                        layerCreationOptions=layerCreationOptions)

        if out_path is None or out_layername is None:
            return [None, None]

        helmert_para = helmert_para_dict(midSRS, dstSRS)

        [out_path, out_layername] = self.transform_direct(midSRS, dstSRS, midpath, outpath, outlayername, outformat,
                                                        helmert_para=helmert_para)

        return [out_path, out_layername] if out_path is not None and out_layername is not None else None
Exemple #2
0
    def pcs_2000_to_sz_local(self, inpath=None, outpath=None, outlayername=None, outformat=None):
        para_pcs_2000_to_sz = helmert_para_dict(SpatialReference.pcs_2000, SpatialReference.sz_Local)

        [out_path, out_layername] = self.transform_direct(4547, 2435, inpath, outpath,
                                                        outlayername, outformat, helmert_para=para_pcs_2000_to_sz)

        return [out_path, out_layername] if out_path is not None and out_layername is not None else None
Exemple #3
0
 def pcs_2000_to_sz_local(self, points):
     helmert_para = helmert_para_dict(4547, 2435, "EAST")
     opt = osr.CoordinateTransformationOptions()
     opt.SetOperation(helmert_para)
     tr = osr.CreateCoordinateTransformation(None, None, opt)
     points = osr.CoordinateTransformation.TransformPoints(tr, points)
     return points