]> granicus.if.org Git - postgis/commitdiff
Removed RASTER_getPixelPolygon as it has been replaced with
authorBborie Park <bkpark at ucdavis.edu>
Tue, 3 Jul 2012 22:30:06 +0000 (22:30 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 3 Jul 2012 22:30:06 +0000 (22:30 +0000)
RASTER_getPixelPolygons

git-svn-id: http://svn.osgeo.org/postgis/trunk@10023 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rt_pg.c

index 459751d4449db61495fc26862bda15bac131a3ca..9cac44dbd9feccbc28df70ce02c1481287367acd 100644 (file)
@@ -200,7 +200,6 @@ Datum RASTER_getPixelValue(PG_FUNCTION_ARGS);
 Datum RASTER_setPixelValue(PG_FUNCTION_ARGS);
 
 /* Get pixel geographical shape */
-Datum RASTER_getPixelPolygon(PG_FUNCTION_ARGS);
 Datum RASTER_getPixelPolygons(PG_FUNCTION_ARGS);
 
 /* Get pixels of value */
@@ -2442,61 +2441,6 @@ Datum RASTER_setPixelValue(PG_FUNCTION_ARGS)
        PG_RETURN_POINTER(pgrtn);
 }
 
-/**
- * Return the geographical shape of a single pixel.
- * Pixel location is specified by 
- * X,Y coordinates (X <= RT_Width(raster) and Y <= RT_Height(raster)).
- *
- */
-PG_FUNCTION_INFO_V1(RASTER_getPixelPolygon);
-Datum RASTER_getPixelPolygon(PG_FUNCTION_ARGS)
-{
-    rt_pgraster *pgraster = NULL;
-    rt_raster raster = NULL;
-    LWPOLY *poly;
-    int32_t x = 0;
-    int32_t y = 0;
-    GSERIALIZED* gser = NULL;
-
-
-    /* Deserialize raster */
-    pgraster = (rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
-
-    x = PG_GETARG_INT32(1);
-
-    y = PG_GETARG_INT32(2);
-
-    POSTGIS_RT_DEBUGF(3, "Pixel coordinates (%d, %d)", x, y);
-
-    raster = rt_raster_deserialize(pgraster, FALSE);
-    if (!raster) {
-        elog(ERROR, "RASTER_getPixelPolygon: Could not deserialize raster");
-        PG_FREE_IF_COPY(pgraster, 0);
-        PG_RETURN_NULL();
-    }
-
-    /* Fetch pixel shape */
-    poly = rt_raster_pixel_as_polygon(raster, x - 1, y - 1);
-    if (!poly) {
-        elog(ERROR, "RASTER_getPixelPolygon: could not get raster's pixel polygon");
-        rt_raster_destroy(raster);
-        PG_FREE_IF_COPY(pgraster, 0);
-        PG_RETURN_NULL();
-    }
-
-    {
-        size_t gser_size;
-        gser = gserialized_from_lwgeom(lwpoly_as_lwgeom(poly), 0, &gser_size);
-        SET_VARSIZE(gser, gser_size);
-    }
-
-    rt_raster_destroy(raster);
-    PG_FREE_IF_COPY(pgraster, 0);
-    pfree(poly);
-
-    PG_RETURN_POINTER(gser);
-}
-
 /**
  * Return the geographical shape of all pixels
  */