0

I was previously clipping a DEM (SRTM 30m) with one GeoJSON polygon and getting good results. With another GeoJSON polygon, I'm getting NaN values for the clipped raster. Any ideas on what is going on?

The good polygon:

{
    "type": "FeatureCollection",
    "crs": {
        "type": "name",
        "properties": {
            "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
        }
    },
    "features": [{
        "type": "Feature",
        "properties": {
            "_slopemean": 89.991593497140073,
            "_slopestdev": 0.0007812262490126589,
            "_slopemin": 89.990058898925781,
            "_slopemax": 89.9927978515625,
            "_aspectmean2": null,
            "_aspectstdev2": null,
            "_aspectmin2": null,
            "_aspectmax2": null
        },
        "geometry": {
            "type": "Polygon",
            "coordinates": [[[35.465406775474548,
            33.033829221177918],
            [35.463507771492004,
            33.032489029387897],
            [35.464510917663567,
            33.032668922087709],
            [35.465508699417114,
            33.032875798238493],
            [35.465970039367676,
            33.033100663068907],
            [35.465980768203735,
            33.033316532766257],
            [35.465701818466187,
            33.033392986490597],
            [35.465406775474548,
            33.033829221177918]]]
        }
    }]
}

The bad polygon:

{
    "type": "FeatureCollection",
    "crs": {
        "type": "name",
        "properties": {
            "name": "urn:ogc:def:crs:EPSG::32718"
        }
    },
    "features": [{
        "type": "Feature",
        "properties": {
            "Name": "Name",
            "description": null,
            "timestamp": null,
            "begin": null,
            "end": null,
            "altitudeMode": null,
            "tessellate": -1,
            "extrude": 0,
            "visibility": -1,
            "drawOrder": null,
            "icon": null,
            "stroke": "#555555",
            "stroke_width": "2",
            "stroke_opacity": "1",
            "fill": "#555555",
            "fill_opacity": "0.5",
            "Code": "Name"
        },
        "geometry": {
            "type": "Polygon",
            "coordinates": [[[35.543979406356812,
            33.17158011534832,
            0.0],
            [35.543362498283393,
            33.169757071127393,
            0.0],
            [35.543459057807922,
            33.16957296849484,
            0.0],
            [35.544124245643623,
            33.171535213236737,
            0.0],
            [35.543979406356812,
            33.17158011534832,
            0.0]]]
        }
    }]
}
  • Its look like you somehow change the defined CRS on the "bad" polygon. There is UTM (EPSG::32718) while geometry is in WGS84 (EPSG::4326) – Oto Kaláb Jul 10 '17 at 8:54
  • Is there a good way to fix this from within QGIS? – Boris K Jul 10 '17 at 8:59
  • You can change layer CRS in Layer prorerties in General tab. – Oto Kaláb Jul 10 '17 at 9:05
  • I've done this for the offending polygon, to no avail. – Boris K Jul 10 '17 at 9:20
  • Sorry to butt in here, but I feel you need to save the polygon as a new GeoJSON file and reload it to the project. Right-click the layer in the layer panel, select Save As, and then change the CRS to WGS84. – Kazuhito Jul 10 '17 at 15:16

Your Answer

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

Browse other questions tagged or ask your own question.