[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-468-g9ee878621

git at osgeo.org git at osgeo.org
Wed Feb 2 15:42:21 PST 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  9ee87862195400f8483127cdd6ed7bac8322e247 (commit)
       via  3a0ab4b3380e67b973438a8a958ab2c3536548ff (commit)
      from  e57f8deba8d999ed66d518e73104994bc8c6499b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ee87862195400f8483127cdd6ed7bac8322e247
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Feb 2 15:42:17 2022 -0800

    Add line endpoints to doc image generator

diff --git a/doc/html/image_src/generator.c b/doc/html/image_src/generator.c
index 778bff90e..6e8d6ebf1 100644
--- a/doc/html/image_src/generator.c
+++ b/doc/html/image_src/generator.c
@@ -90,6 +90,38 @@ pointarrayToString(char *output, POINTARRAY *pa)
 	return (ptr - output);
 }
 
+/**
+ * Draws a point in a POINTARRAY to a char* using ImageMagick SVG for styling.
+
+ * @param output a char reference to write the LWPOINT to
+ * @param lwp a reference to a LWPOINT
+ * @return the numbers of character written to *output
+ */
+static size_t
+drawPointSymbol(char *output, POINTARRAY *pa, unsigned int index, int size, char* color)
+{
+	// short-circuit no-op
+	if (size <= 0) return 0;
+
+	char x[OUT_DOUBLE_BUFFER_SIZE];
+	char y1[OUT_DOUBLE_BUFFER_SIZE];
+	char y2[OUT_DOUBLE_BUFFER_SIZE];
+	char *ptr = output;
+
+	POINT2D p;
+	getPoint2d_p(pa, index, &p);
+
+	lwprint_double(p.x, 10, x);
+	lwprint_double(p.y, 10, y1);
+	lwprint_double(p.y + size, 10, y2);
+
+	ptr += sprintf(ptr, "-fill %s -strokewidth 0 ", color);
+	ptr += sprintf(ptr, "-draw \"circle %s,%s %s,%s", x, y1, x, y2);
+	ptr += sprintf(ptr, "'\" ");
+
+	return (ptr - output);
+}
+
 /**
  * Serializes a LWPOINT to a char*.  This is a helper function that partially
  * writes the appropriate draw and fill commands used to generate an SVG image
@@ -146,6 +178,9 @@ drawLineString(char *output, LWLINE *lwl, LAYERSTYLE *style)
 	ptr += pointarrayToString(ptr, lwl->points );
 	ptr += sprintf(ptr, "'\" ");
 
+	ptr += drawPointSymbol(ptr, lwl->points, 0, style->lineStartSize, style->lineColor);
+	ptr += drawPointSymbol(ptr, lwl->points, lwl->points->npoints-1, style->lineEndSize, style->lineColor);
+
 	return (ptr - output);
 }
 
@@ -419,6 +454,7 @@ int main( int argc, const char* argv[] )
 		lwgeom_free( lwgeom );
 
 		LWDEBUGF( 4, "%s", output );
+		//puts(output);
 		checked_system(output);
 
 		//-- (MD) disable highlighting since it doesn't work well with opacity
diff --git a/doc/html/image_src/st_issimple01.wkt b/doc/html/image_src/st_issimple01.wkt
index 690d1f5ab..96820eb88 100644
--- a/doc/html/image_src/st_issimple01.wkt
+++ b/doc/html/image_src/st_issimple01.wkt
@@ -1 +1 @@
-ArgA;GEOMETRYCOLLECTION ( LINESTRING ( 10 190, 140 130, 70 80, 190 10 ), POINT(10 190), POINT(190 10) )
+ArgA-endpoints;LINESTRING ( 10 190, 140 130, 70 80, 190 10 )
diff --git a/doc/html/image_src/st_issimple02.wkt b/doc/html/image_src/st_issimple02.wkt
index 78a496445..938d9fa24 100644
--- a/doc/html/image_src/st_issimple02.wkt
+++ b/doc/html/image_src/st_issimple02.wkt
@@ -1 +1 @@
-ArgB;GEOMETRYCOLLECTION ( LINESTRING ( 10 190, 130 40, 170 160, 10 10 ), POINT(10 190), POINT(10 10) )
+ArgB-endpoints;LINESTRING ( 10 190, 130 40, 170 160, 10 10 )
diff --git a/doc/html/image_src/st_issimple03.wkt b/doc/html/image_src/st_issimple03.wkt
index e066e1e05..5087b679a 100644
--- a/doc/html/image_src/st_issimple03.wkt
+++ b/doc/html/image_src/st_issimple03.wkt
@@ -1 +1 @@
-ArgA;GEOMETRYCOLLECTION ( LINESTRING ( 90 190, 120 190, 130 140, 190 50, 70 10, 10 70, 10 150, 90 190 ), POINT(90 190) )
+ArgA-endpoints;LINESTRING ( 90 190, 120 190, 130 140, 190 50, 70 10, 10 70, 10 150, 90 190 )
diff --git a/doc/html/image_src/st_issimple04.wkt b/doc/html/image_src/st_issimple04.wkt
index 26d5a8998..0c4e055d4 100644
--- a/doc/html/image_src/st_issimple04.wkt
+++ b/doc/html/image_src/st_issimple04.wkt
@@ -1 +1 @@
-ArgB;GEOMETRYCOLLECTION ( LINESTRING ( 90 190, 120 190, 50 60, 130 10, 190 50, 160 90, 10 150, 90 190 ), POINT(90 190) )
+ArgB-endpoints;LINESTRING ( 90 190, 120 190, 50 60, 130 10, 190 50, 160 90, 10 150, 90 190 )
diff --git a/doc/html/image_src/st_issimple05.wkt b/doc/html/image_src/st_issimple05.wkt
index c4a17b232..30458db7b 100644
--- a/doc/html/image_src/st_issimple05.wkt
+++ b/doc/html/image_src/st_issimple05.wkt
@@ -1 +1 @@
-ArgA;GEOMETRYCOLLECTION ( LINESTRING ( 30 190, 60 60, 170 10 ), LINESTRING ( 100 190, 180 150, 160 70 ), MULTIPOINT ( 30 190, 170 10, 100 190, 160 70 ) )
+ArgA-endpoints;MULTILINESTRING (( 30 190, 60 60, 170 10 ), ( 100 190, 180 150, 160 70 ))
diff --git a/doc/html/image_src/st_issimple06.wkt b/doc/html/image_src/st_issimple06.wkt
index 0caf2dab4..8db798269 100644
--- a/doc/html/image_src/st_issimple06.wkt
+++ b/doc/html/image_src/st_issimple06.wkt
@@ -1 +1 @@
-ArgA;GEOMETRYCOLLECTION ( LINESTRING ( 30 190, 60 60, 170 10 ), LINESTRING ( 30 190, 180 150, 160 70 ), MULTIPOINT( 170 10, 30 190, 170 10, 160 70 ) )
+ArgA-endpoints;MULTILINESTRING (( 30 190, 60 60, 170 10 ), ( 30 190, 180 150, 160 70 ))
diff --git a/doc/html/image_src/st_issimple07.wkt b/doc/html/image_src/st_issimple07.wkt
index ea5ae8e44..78f357643 100644
--- a/doc/html/image_src/st_issimple07.wkt
+++ b/doc/html/image_src/st_issimple07.wkt
@@ -1 +1 @@
-ArgB;GEOMETRYCOLLECTION ( LINESTRING ( 30 190, 60 60, 170 10 ), LINESTRING (100 190, 180 150, 80 10), MULTIPOINT( 30 190, 170 10, 100 190, 80 10 ) )
+ArgB-endpoints;MULTILINESTRING (( 30 190, 60 60, 170 10 ), (100 190, 180 150, 80 10))
diff --git a/doc/html/image_src/styles.c b/doc/html/image_src/styles.c
index d22c0ae12..587afb1ed 100644
--- a/doc/html/image_src/styles.c
+++ b/doc/html/image_src/styles.c
@@ -46,6 +46,8 @@ getStyles( const char *filename, LAYERSTYLE **headRef )
 			char *pointColor = "Grey";
 			int lineWidth = 5;
 			char *lineColor = "Grey";
+			int lineStartSize = 0;
+			int lineEndSize = 0;
 			char *polygonFillColor = "Grey";
 			char *polygonStrokeColor = "Grey";
 			int polygonStrokeWidth = 0;
@@ -76,6 +78,21 @@ getStyles( const char *filename, LAYERSTYLE **headRef )
 					}
 					else if (strncmp(line, "lineColor", 9) == 0)
 						lineColor = ptr;
+					else if (strncmp(line, "lineWidth", 9) == 0)
+					{
+						lineWidth = atoi(ptr);
+						free(ptr);
+					}
+					else if (strncmp(line, "lineStartSize", 13) == 0)
+					{
+						lineStartSize = atoi(ptr);
+						free(ptr);
+					}
+					else if (strncmp(line, "lineEndSize", 11) == 0)
+					{
+						lineEndSize = atoi(ptr);
+						free(ptr);
+					}
 					else if (strncmp(line, "polygonFillColor", 16) == 0)
 						polygonFillColor = ptr;
 					else if (strncmp(line, "polygonStrokeColor", 18) == 0)
@@ -85,17 +102,15 @@ getStyles( const char *filename, LAYERSTYLE **headRef )
 						polygonStrokeWidth = atoi(ptr);
 						free(ptr);
 					}
-
 				}
 				getResults = fgets ( line, sizeof line, pFile );
 			}
-
-			addStyle(headRef, styleName, pointSize, pointColor, lineWidth, lineColor, polygonFillColor, polygonStrokeColor, polygonStrokeWidth);
+			addStyle(headRef, styleName, pointSize, pointColor,
+				lineWidth, lineColor, lineStartSize, lineEndSize,
+				polygonFillColor, polygonStrokeColor, polygonStrokeWidth);
 		}
-
 		getResults = fgets ( line, sizeof line, pFile );
 	}
-
 	fclose( pFile );
 }
 
@@ -128,6 +143,7 @@ addStyle(
     char* styleName,
     int pointSize, char* pointColor,
     int lineWidth, char* lineColor,
+	int lineStartSize, int lineEndSize,
     char* polygonFillColor, char* polygonStrokeColor, int polygonStrokeWidth)
 {
 	LAYERSTYLE *style = malloc( sizeof(LAYERSTYLE) );
@@ -137,6 +153,8 @@ addStyle(
 	style->pointColor = pointColor;
 	style->lineWidth = lineWidth;
 	style->lineColor = lineColor;
+	style->lineStartSize = lineStartSize;
+	style->lineEndSize = lineEndSize;
 	style->polygonFillColor = polygonFillColor;
 	style->polygonStrokeColor = polygonStrokeColor;
 	style->polygonStrokeWidth = polygonStrokeWidth;
diff --git a/doc/html/image_src/styles.conf b/doc/html/image_src/styles.conf
index e536e8966..e7e7d0875 100644
--- a/doc/html/image_src/styles.conf
+++ b/doc/html/image_src/styles.conf
@@ -51,6 +51,19 @@ polygonFillColor = "#C0D0F080"
 polygonStrokeColor = "#6495ED"
 polygonStrokeWidth = 2
 
+[Style]
+# Argument A with line endpoints
+styleName = ArgA-endpoints
+pointSize = 5
+pointColor = "#6495ED"
+lineWidth = 4
+lineColor = "#6495ED"
+lineStartSize = 5
+lineEndSize = 5
+polygonFillColor = "#C0D0F080"
+polygonStrokeColor = "#6495ED"
+polygonStrokeWidth = 2
+
 [Style]
 # Argument B
 styleName = ArgB
@@ -73,6 +86,19 @@ polygonFillColor = "#00ffa040"
 polygonStrokeColor = "#7ACAC4"
 polygonStrokeWidth = 1
 
+[Style]
+# Argument B with line endpoints
+styleName = ArgB-endpoints
+pointSize = 5
+pointColor = "#7ACAC4"
+lineWidth = 4
+lineColor = "#7ACAC4"
+lineStartSize = 5
+lineEndSize = 5
+polygonFillColor = "#00ffa040"
+polygonStrokeColor = "#7ACAC4"
+polygonStrokeWidth = 2
+
 [Style]
 # Result
 styleName = Result
diff --git a/doc/html/image_src/styles.h b/doc/html/image_src/styles.h
index 78144e5d8..cf1688d35 100644
--- a/doc/html/image_src/styles.h
+++ b/doc/html/image_src/styles.h
@@ -26,6 +26,9 @@ struct layerStyle
 	int   lineWidth;
 	char *lineColor;
 
+	int   lineStartSize;
+	int   lineEndSize;
+
 	char *polygonFillColor;
 	char *polygonStrokeColor;
 	int   polygonStrokeWidth;
@@ -35,7 +38,7 @@ struct layerStyle
 
 void getStyles( const char *filename, LAYERSTYLE **headRef );
 void freeStyles( LAYERSTYLE **headRef );
-void addStyle( LAYERSTYLE **headRef, char* styleName, int pointSize, char* pointColor, int lineWidth, char* lineColor, char* polygonFillColor, char* polygonStrokeColor, int polygonStrokeWidth );
+void addStyle( LAYERSTYLE **headRef, char* styleName, int pointSize, char* pointColor, int lineWidth, char* lineColor, int lineStartSize, int lineEndSize, char* polygonFillColor, char* polygonStrokeColor, int polygonStrokeWidth );
 
 int length( LAYERSTYLE *headRef );
 LAYERSTYLE* getStyle( LAYERSTYLE *headRef, char* styleName );

commit 3a0ab4b3380e67b973438a8a958ab2c3536548ff
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Wed Feb 2 15:41:40 2022 -0800

    Improve doc validation image captions

diff --git a/doc/using_postgis_dataman.xml b/doc/using_postgis_dataman.xml
index 805589c53..04bb341cb 100644
--- a/doc/using_postgis_dataman.xml
+++ b/doc/using_postgis_dataman.xml
@@ -1364,12 +1364,12 @@ VALUES ( 990000,
 		<tgroup cols="1">
 		  <tbody>
 			<row>
-				<entry><para>In these examples
+				<entry><para><emphasis>
                 <emphasis role="bold">(a)</emphasis> and
 				<emphasis role="bold">(c)</emphasis> are simple	<varname>LINESTRING</varname>s.
                 <emphasis role="bold">(b)</emphasis> and <emphasis role="bold">(d)</emphasis> are not simple.
-                <emphasis role="bold">(c)</emphasis> and <emphasis role="bold">(d)</emphasis> are closed Linear Rings.
-                </para></entry>
+                <emphasis role="bold">(c)</emphasis> is a closed Linear Ring.
+                </emphasis></para></entry>
 			</row>
 		  </tbody>
 		</tgroup>
@@ -1432,11 +1432,12 @@ VALUES ( 990000,
 		<tgroup cols="1">
 		  <tbody>
 			<row>
-				<entry><para>In these examples
+				<entry><para><emphasis>
                 <emphasis role="bold">(e)</emphasis> and
 				<emphasis role="bold">(f)</emphasis> are simple
-				<varname>MULTILINESTRING</varname>s, <emphasis role="bold">(g)</emphasis>
-				is not.</para></entry>
+				<varname>MULTILINESTRING</varname>s.
+                <emphasis role="bold">(g)</emphasis> is not simple.
+                </emphasis></para></entry>
 			</row>
 		  </tbody>
 		</tgroup>
@@ -1510,13 +1511,13 @@ VALUES ( 990000,
 		<tgroup cols="1">
 		  <tbody>
 			<row>
-				<entry><para>In these examples
+				<entry><para><emphasis>
                 <emphasis role="bold">(h)</emphasis> and
 				<emphasis role="bold">(i)</emphasis> are valid <varname>POLYGON</varname>s.
-                <emphasis role="bold">(j-m)</emphasis> are invalid
-				(but <emphasis role="bold">(j)</emphasis>
-				could be represented as a valid <varname>MULTIPOLYGON</varname>).
-				</para></entry>
+                <emphasis role="bold">(j-m)</emphasis> are invalid.
+				<emphasis role="bold">(j)</emphasis>
+				could be represented as a valid <varname>MULTIPOLYGON</varname>.
+				</emphasis></para></entry>
 			</row>
 		  </tbody>
 		</tgroup>
@@ -1608,10 +1609,10 @@ VALUES ( 990000,
 		<tgroup cols="1">
 		  <tbody>
 			<row>
-				<entry><para>In these examples
+				<entry><para><emphasis>
                 <emphasis role="bold">(n)</emphasis> is a valid <varname>MULTIPOLYGON</varname>.
 				<emphasis role="bold">(o)</emphasis> and <emphasis role="bold">(p)</emphasis> are not valid.
-                </para></entry>
+                </emphasis></para></entry>
 			</row>
 		  </tbody>
 		</tgroup>

-----------------------------------------------------------------------

Summary of changes:
 doc/html/image_src/generator.c       | 36 ++++++++++++++++++++++++++++++++++++
 doc/html/image_src/st_issimple01.wkt |  2 +-
 doc/html/image_src/st_issimple02.wkt |  2 +-
 doc/html/image_src/st_issimple03.wkt |  2 +-
 doc/html/image_src/st_issimple04.wkt |  2 +-
 doc/html/image_src/st_issimple05.wkt |  2 +-
 doc/html/image_src/st_issimple06.wkt |  2 +-
 doc/html/image_src/st_issimple07.wkt |  2 +-
 doc/html/image_src/styles.c          | 28 +++++++++++++++++++++++-----
 doc/html/image_src/styles.conf       | 26 ++++++++++++++++++++++++++
 doc/html/image_src/styles.h          |  5 ++++-
 doc/using_postgis_dataman.xml        | 27 ++++++++++++++-------------
 12 files changed, 110 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list