]> granicus.if.org Git - postgis/commitdiff
added a few comments to aid in image generation.
authorKevin Neufeld <kneufeld.ca@gmail.com>
Fri, 11 Sep 2009 03:19:19 +0000 (03:19 +0000)
committerKevin Neufeld <kneufeld.ca@gmail.com>
Fri, 11 Sep 2009 03:19:19 +0000 (03:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4477 b70326c6-7e19-0410-871a-916f4a2858ee

doc/html/image_src/generator.c
doc/html/image_src/styles.c

index dcd8542b94b0dbcce39933566812c6f4fed80ddf..8b8e2871cd94e7b6c08fc253a3cbf77e5cda93b5 100644 (file)
  * The goal of this application is to dynamically generate all the spatial
  * pictures used in PostGIS's documentation pages.
  *
- * Note: the coordinates of the supplied geometries should be within the x-y range
- * of 200, otherwise they will appear outside of the generated image.
+ * Note: the coordinates of the supplied geometries should be within and scaled
+ * to the x-y range of [0,200], otherwise the rendered geometries may be 
+ * rendered outside of the generated image's extents, or may be rendered too
+ * small to be recognizable as anything other than a single point.
  *
  **********************************************************************/
 
@@ -106,6 +108,9 @@ drawPoint(char *output, LWPOINT *lwp, LAYERSTYLE *styles)
        POINTARRAY *pa = lwp->point;
        POINT2D p;
        getPoint2d_p(pa, 0, &p);
+       
+       LWDEBUGF(4, "%s", "drawPoint called");
+       LWDEBUGF( 4, "point = %s", lwgeom_to_ewkt((LWGEOM*)lwp,0) );
 
        sprintf(x, "%f", p.x);
        trim_trailing_zeros(x);
@@ -135,6 +140,9 @@ drawLineString(char *output, LWLINE *lwl, LAYERSTYLE *style)
 {
        char *ptr = output;
 
+       LWDEBUGF(4, "%s", "drawLineString called");
+       LWDEBUGF( 4, "line = %s", lwgeom_to_ewkt((LWGEOM*)lwl,0) );
+       
        ptr += sprintf(ptr, "-fill none -stroke %s -strokewidth %d ", style->lineColor, style->lineWidth);
        ptr += sprintf(ptr, "-draw \"stroke-linecap round stroke-linejoin round path 'M ");
        ptr += pointarrayToString(ptr, lwl->points );
@@ -158,6 +166,9 @@ drawPolygon(char *output, LWPOLY *lwp, LAYERSTYLE *style)
        char *ptr = output;
        int i;
 
+       LWDEBUGF(4, "%s", "drawPolygon called");
+       LWDEBUGF( 4, "poly = %s", lwgeom_to_ewkt((LWGEOM*)lwp,0) );
+       
        ptr += sprintf(ptr, "-fill %s -stroke %s -strokewidth %d ", style->polygonFillColor, style->polygonStrokeColor, style->polygonStrokeWidth );
        ptr += sprintf(ptr, "-draw \"path '");
        for (i=0; i<lwp->nrings; i++)
@@ -227,8 +238,8 @@ addDropShadow(int layerNumber)
            str,
            "convert tmp%d.png -gravity center \\( +clone -background navy -shadow 100x3+4+4 \\) +swap -background none -flatten tmp%d.png",
            layerNumber, layerNumber);
-       system(str);
        LWDEBUGF(4, "%s", str);
+       system(str);
 }
 
 /**
@@ -246,8 +257,8 @@ addHighlight(int layerNumber)
            str,
            "convert tmp%d.png \\( +clone -channel A -separate +channel -negate -background black -virtual-pixel background -blur 0x3 -shade 120x55 -contrast-stretch 0%% +sigmoidal-contrast 7x50%% -fill grey50 -colorize 10%% +clone +swap -compose overlay -composite \\) -compose In -composite tmp%d.png",
            layerNumber, layerNumber);
-       system(str);
        LWDEBUGF(4, "%s", str);
+       system(str);
 }
 
 /**
@@ -262,8 +273,8 @@ optimizeImage(char* filename)
        char *str;
        str = malloc( (18 + (2*strlen(filename)) + 1) * sizeof(char) );
        sprintf(str, "convert %s -depth 8 %s", filename, filename);
-       system(str);
        LWDEBUGF(4, "%s", str);
+       system(str);
        free(str);
 }
 
index 4edf9f2c94b5eb58ac9571a59ca441ea50fb4a09..9a5a8864aec2c14f9f5cf8fa41861f43164eb9b0 100644 (file)
@@ -31,7 +31,7 @@ getStyles( LAYERSTYLE **headRef )
 
        if ((pFile = fopen("styles.conf", "r")) == NULL)
        {
-               perror ( "styles.properties: No such file or directory" );
+               perror ( "styles.conf: No such file or directory" );
                return;
        }