1

The shapefiles I was sent did not contain a .prj file, and instead came with these .xml files that seem to be the equivalent of the projection file. QGis does not seem to 'read' these XML files when I import the associated shapefiles, and results in the imported polygons being totally out of place and out of scale.

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <coordinateSystem>
        <name>Universal Transverse Mercator - Zone 51 (N)</name>
        <datum>World Geodetic 1984 (WGS84)</datum>
        <system>Transverse Mercator</system>
        <unit>Meter</unit>
        <majorAxis>6.378137000000000000000000e+006</majorAxis>
        <eccentricity>8.181919084262148600000000e-002</eccentricity>
        <centerX>0.000000000000000000000000e+000</centerX>
        <centerY>0.000000000000000000000000e+000</centerY>
        <centerZ>0.000000000000000000000000e+000</centerZ>
        <rotationX>0.000000000000000000000000e+000</rotationX>
        <rotationY>0.000000000000000000000000e+000</rotationY>
        <rotationZ>0.000000000000000000000000e+000</rotationZ>
        <scaleAdjustment>0.000000000000000000000000e+000</scaleAdjustment>
        <scaleX>9.996000000000000400000000e-001</scaleX>
        <localScaleX>1.000000000000000000000000e+000</localScaleX>
        <scaleY>9.996000000000000400000000e-001</scaleY>
        <localScaleY>1.000000000000000000000000e+000</localScaleY>
        <falseEasting>5.000000000000000000000000e+005</falseEasting>
        <localOffsetX>0.000000000000000000000000e+000</localOffsetX>
        <falseNorthing>0.000000000000000000000000e+000</falseNorthing>
        <localOffsetY>0.000000000000000000000000e+000</localOffsetY>
        <centerLat>0.000000000000000000000000e+000</centerLat>
        <centerLon>1.230000000000000000000000e+002</centerLon>
    </coordinateSystem>
</data>
2

You could manually create your own PRJ file using a text editor, all the information you need is there. Just use any existing PRJ as a template.

Alternatively, open the shapefile in QGIS, assign the correct projection (right click, properties, general), then save/export as a new shapefile, being sure to select the correct CRS when you do this.

|improve this answer|||||
  • 1
    you can look it up on epsg.io or spatialreference.org and download the .prj file – Ian Turton Feb 13 '17 at 9:13
  • Is there a way to import this as a custom CRS in QGIS? I'm not quite sure how to write down the other variables in the .prj such as scalex and y. – Bobby Kew Feb 13 '17 at 10:04
  • No need, it is a standard CRS already loaded in QGIS (and every other GIS software ever, I would imagine). ESPG: 32651 – Matt Feb 13 '17 at 10:12
  • Also, you won't need to include everything in the XML file in the PRJ, just fill in whatever was there in the template PRJ you are using – Matt Feb 13 '17 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.