Check-in [4d809cf60a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:implenting support for RL2 Map Configuration
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d809cf60a4b4c50d053c214d2f1a50e0e88824e
User & Date: sandro 2020-03-10 16:13:55
Context
2020-03-12
19:45
implementing support for Temporary Geometries check-in: 8530392951 user: sandro tags: trunk
2020-03-10
16:13
implenting support for RL2 Map Configuration check-in: 4d809cf60a user: sandro tags: trunk
2020-01-10
17:03
switching to automake 1.16.1 and many miscellaneous fixes check-in: 4ed175d571 user: sandro tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to spatialite-sql-latest.html.

3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
....
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
....
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
....
4126
4127
4128
4129
4130
4131
4132












































4133
4134
4135
4136
4137
4138
4139
....
4632
4633
4634
4635
4636
4637
4638






4639
4640
4641
4642
4643
4644
4645
4646
4647






4648
4649
4650
4651
4652
4653
4654
....
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
....
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
				<td>SE_UnregisterVectorStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterVectorStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Vector Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Anyway any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>VectorStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>VectorStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadVectorStyle</b></td>
................................................................................
				<td>SE_UnregisterRasterStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterRasterStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Raster Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Anyway any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>RasterStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>RasterStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadRasterStyle</b></td>
................................................................................
				<td>SE_UnregisterGroupStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterGroupStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Group Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Anyway any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>RasterStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>RasterStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadGroupStyle</b></td>
................................................................................
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an association between a <b>Group Style</b> and a <b>Styled Group</b>.
				<ul>
					<li><b>group_name</b> must identify an existing Styled Group.</li>
					<li>An already associated Style can be referenced either by its unique <b>Stile ID</b> or by its <b>Name</b>;
					anyway a reference <i>by Name</i> could eventually fail if the Name is ambiguous (duplicate).</li>
				</ul><hr>












































the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
			<tr><td colspan="5" align="center" bgcolor="#f0f0c0">
				<h3><a name="p16isometa">SQL functions supporting ISO Metadata</a></h3></td></tr>
			<tr><th bgcolor="#d0d0d0">Function</th>
				<th bgcolor="#d0d0d0">Syntax</th>
				<th bgcolor="#d0d0d0">OGC<br>defined</th>
................................................................................
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsSldSeRasterStyle</b></td>
				<td>XB_IsSldSeRasterStyle( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>






			<tr><td><b>XB_IsSvg</b></td>
				<td>XB_IsSvg( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsGpx</b></td>
				<td>XB_IsGpx( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>






				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_GetDocumentSize</b></td>
				<td>XB_GetDocumentSize( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
................................................................................
						if <b>"db"."table"</b> does not contains any Geometry column, or contains more than one, an exception will be raised.<br>
						Otherwise the given column name in <b>"db-prefix"."column-name"</b> will be used if it exists.</li>
						<li>the input GeoTable must be properly registered and must match both the <b>SRID</b> and <b>dimensions</b> declared in the target Topology.</li>
						<li>this function accepts input Geometries of any class: <b>Point</b>, <b>MultiPoint</b>, <b>Linestring</b>, <b>MultiLinestring</b>,
						<b>Polygon</b>, <b>MultiPolygon</b>, <b>GeometryCollection</b> and <b>Geometry</b>.</li>
						<li>The optional arguments <i>line_max_points</i> and <i>line_max_length</i> will be interpreted in the same way as used in <b>TopoGeo_SubdivideLines()</b> 
						(default for both: <b>NULL</b> [<u>ignore</u>]).</li>
				        <li>The optional argument <i>tolerance</i>, when omitted, will assume the corresponding value used with <b>Create>Topology()</b>.</li>
				        <li>This function will end after the <b>first</b> encountered Topology exception.</li>
					</ul><hr>
					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
			<tr><td><b>TopoGeo_FromGeoTableNoFace</b></td>
				<td>TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> ) : <i>Integer</i><hr>
				    TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , line_max_points <i>Integer</i> ) : <i>Integer</i><hr>
				    TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , line_max_points <i>Integer</i> , 
................................................................................
						and will be automatically created by the function itself.<br>
						<u>Note</u>: both the <i>dustbin-table</i> and the <i>dustbin-view</i> will be created on the same DB containing the input GeoTable.
						Use <b>DropGetoTable()</b> for both <i>dustbin-table</i> and <i>dustbin-view</i> before recalling, or even better use different names for each call.</li>
						<li>this function accepts input Geometries of any class: <b>Point</b>, <b>MultiPoint</b>, <b>Linestring</b>, <b>MultiLinestring</b>,
						<b>Polygon</b>, <b>MultiPolygon</b>, <b>GeometryCollection</b> and <b>Geometry</b>.</li>
						<li>The optional arguments <i>line_max_points</i> and <i>line_max_length</i> will be interpreted in the same way as used in <b>TopoGeo_SubdivideLines()</b> 
						(default for both: <b>NULL</b> [<u>ignore</u>]).</li>
				        <li>The optional argument <i>tolerance</i>, when omitted, will assume the corresponding value used with <b>Create>Topology()</b>.</li>
				        <li>This function will end after the <b>first</b> encountered Topology exception.</li>
					</ul><hr>
					Will return <b>0</b> on full success or a <b>positive</b> integer corresponding to the total count of failing features referenced by the <i>dustbin</i> table.<br>
					An exception will be raised for any invalid argument.</td></tr>
			<tr><td><b>TopoGeo_FromGeoTableNoFaceExt</b></td>
				<td>TopoGeo_FromGeoTableNoFaceExt( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , dustbin-table <i>Text</i> , 
				    dustbin-view <i>Text</i> ) : <i>Integer</i><hr>







|







 







|







 







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>









>
>
>
>
>
>







 







|







 







|







3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
....
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
....
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
....
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
....
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
....
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
....
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
				<td>SE_UnregisterVectorStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterVectorStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Vector Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>VectorStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>VectorStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadVectorStyle</b></td>
................................................................................
				<td>SE_UnregisterRasterStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterRasterStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Raster Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>RasterStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>RasterStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadRasterStyle</b></td>
................................................................................
				<td>SE_UnregisterGroupStyle( style_id <i>Integer</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i><hr>
					SE_UnregisterGroupStyle( style_name <i>Text</i> [ , remove_all <i>Integer</i> ] ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>Group Style</b> definition.
				<ul>
					<li>The Style to be removed could be referenced either by its unique <b>Style Id</b> or by its <b>Style Name</b>.<br>
					Any attempt to remove a Style identified by its <b>Name</b> will be rejected if the if two (or more) Styles share the same <b>Name</b> thus causing ambiguity.</li>
					<li>when the <i>optional</i> argument <b>remove_all</b> is explicitly set to <b>TRUE</b> the Style will be removed even if it's already referenced by some
					<b>RasterStyledLayer</b> and all dependings references will be removed at the same time.<br>
					In any other case any attempt to unregister a Style already referenced by one (or more) <b>RasterStyleLayer</b> will be rejected.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>SE_ReloadGroupStyle</b></td>
................................................................................
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an association between a <b>Group Style</b> and a <b>Styled Group</b>.
				<ul>
					<li><b>group_name</b> must identify an existing Styled Group.</li>
					<li>An already associated Style can be referenced either by its unique <b>Stile ID</b> or by its <b>Name</b>;
					anyway a reference <i>by Name</i> could eventually fail if the Name is ambiguous (duplicate).</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
			<tr><td colspan="5" align="center" bgcolor="#f0f0c0">
				<h3><a name="p16isometa">SQL functions supporting RL2 Map Configurations</a></h3></td></tr>
			<tr><th bgcolor="#d0d0d0">Function</th>
				<th bgcolor="#d0d0d0">Syntax</th>
				<th bgcolor="#d0d0d0">OGC<br>defined</th>
				<th bgcolor="#d0d0d0">required<br>module</th>
				<th bgcolor="#d0d0d0">Summary</th></tr>	
		<tr><td><b>RL2_RegisterMapConfiguration</b></td>
				<td>RL2_RegisterMapConfiguration( config <i>BLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Inserts a new <b>RL2 Map Configuration</b> definition.
				<ul>
					<li><b>config</b> is expected to be an XmlBLOB containing a valid RL2 Map Configuration.<br>
					If <b>CreateStylingTables()</b> was invoked without specifying the <i>relaxed</i> option this XmlBLOB is expected to have successfully passed a formal XML Schema Validation.<br>
					The registered RL2 Map Configuration will be identified either by its unique <b>Config ID</b> or by its <b>Config Name</b> automatically retrieved from XML.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>RL2_UnregisterMapConfiguration</b></td>
				<td>RL2_UnregisterMapConfiguration( config_id <i>Integer</i> ) : <i>Integer</i><hr>
					RL2_UnregisterMapConfiguration( config_name <i>Text</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Removes an already registered <b>RL2 Map Configuration</b> definition.
				<ul>
					<li>The Map Configuration to be removed could be referenced either by its unique <b>Config Id</b> or by its <b>Config Name</b>.<br>
					Any attempt to remove a Map Configuration identified by its <b>Name</b> will be rejected if the if two (or more) Configurations share the same <b>Name</b> thus causing ambiguity.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
		<tr><td><b>RL2_ReloadMapConfiguration</b></td>
				<td>RL2_ReloadMapConfiguration( config_id <i>Integer</i> , config <i>BLOB</i> ) : <i>Integer</i><hr>
					RL2_ReloadMapConfiguration( config_name <i>Text</i> , config <i>BLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>Updates an already existing <b>RL2 Map Configuration</b> definition.
				<ul>
					<li><b>config</b> is expected to be an XmlBLOB containing a valid RL2 Map Configuration.<br>
					If <b>CreateStylingTables()</b> was invoked without specifying the <i>relaxed</i> option this XmlBLOB is expected to have successfully passed a formal XML Schema Validation.<br>
					The updated Map Configuration will continue to be identified by its current unique <b>Config ID</b> but the <b>Config Name</b> will be automatically updated accordingly to XML.</li>
				</ul><hr>
the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure): -1 will be
				returned on invalid arguments.</td></tr>
			<tr><td colspan="5" align="center" bgcolor="#f0f0c0">
				<h3><a name="p16isometa">SQL functions supporting ISO Metadata</a></h3></td></tr>
			<tr><th bgcolor="#d0d0d0">Function</th>
				<th bgcolor="#d0d0d0">Syntax</th>
				<th bgcolor="#d0d0d0">OGC<br>defined</th>
................................................................................
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsSldSeRasterStyle</b></td>
				<td>XB_IsSldSeRasterStyle( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsSldStyle</b></td>
				<td>XB_IsSldStyle( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsSvg</b></td>
				<td>XB_IsSvg( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsGpx</b></td>
				<td>XB_IsGpx( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_IsMapConfig</b></td>
				<td>XB_IsMapConfig( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
				<td>The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and &#8211;1 for UNKNOWN
					when called with a NULL argument.</td></tr>
			<tr><td><b>XB_GetDocumentSize</b></td>
				<td>XB_GetDocumentSize( xmlObject <i>XmlBLOB</i> ) : <i>Integer</i></td>
				<td></td>
				<td align="center" bgcolor="#99d099">libxml2</td>
................................................................................
						if <b>"db"."table"</b> does not contains any Geometry column, or contains more than one, an exception will be raised.<br>
						Otherwise the given column name in <b>"db-prefix"."column-name"</b> will be used if it exists.</li>
						<li>the input GeoTable must be properly registered and must match both the <b>SRID</b> and <b>dimensions</b> declared in the target Topology.</li>
						<li>this function accepts input Geometries of any class: <b>Point</b>, <b>MultiPoint</b>, <b>Linestring</b>, <b>MultiLinestring</b>,
						<b>Polygon</b>, <b>MultiPolygon</b>, <b>GeometryCollection</b> and <b>Geometry</b>.</li>
						<li>The optional arguments <i>line_max_points</i> and <i>line_max_length</i> will be interpreted in the same way as used in <b>TopoGeo_SubdivideLines()</b> 
						(default for both: <b>NULL</b> [<u>ignore</u>]).</li>
				        <li>The optional argument <i>tolerance</i>, when omitted, will assume the corresponding value used with <b>CreateTopology()</b>.</li>
				        <li>This function will end after the <b>first</b> encountered Topology exception.</li>
					</ul><hr>
					Will return <b>1</b> on success; an exception will be raised on failure.</td></tr>
			<tr><td><b>TopoGeo_FromGeoTableNoFace</b></td>
				<td>TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> ) : <i>Integer</i><hr>
				    TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , line_max_points <i>Integer</i> ) : <i>Integer</i><hr>
				    TopoGeo_FromGeoTableNoFace( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , line_max_points <i>Integer</i> , 
................................................................................
						and will be automatically created by the function itself.<br>
						<u>Note</u>: both the <i>dustbin-table</i> and the <i>dustbin-view</i> will be created on the same DB containing the input GeoTable.
						Use <b>DropGetoTable()</b> for both <i>dustbin-table</i> and <i>dustbin-view</i> before recalling, or even better use different names for each call.</li>
						<li>this function accepts input Geometries of any class: <b>Point</b>, <b>MultiPoint</b>, <b>Linestring</b>, <b>MultiLinestring</b>,
						<b>Polygon</b>, <b>MultiPolygon</b>, <b>GeometryCollection</b> and <b>Geometry</b>.</li>
						<li>The optional arguments <i>line_max_points</i> and <i>line_max_length</i> will be interpreted in the same way as used in <b>TopoGeo_SubdivideLines()</b> 
						(default for both: <b>NULL</b> [<u>ignore</u>]).</li>
				        <li>The optional argument <i>tolerance</i>, when omitted, will assume the corresponding value used with <b>CreateTopology()</b>.</li>
				        <li>This function will end after the <b>first</b> encountered Topology exception.</li>
					</ul><hr>
					Will return <b>0</b> on full success or a <b>positive</b> integer corresponding to the total count of failing features referenced by the <i>dustbin</i> table.<br>
					An exception will be raised for any invalid argument.</td></tr>
			<tr><td><b>TopoGeo_FromGeoTableNoFaceExt</b></td>
				<td>TopoGeo_FromGeoTableNoFaceExt( toponame <i>Text</i> , db-prefix <i>Text</i> , table-name <i>Text</i> , column-name <i>Text</i> , dustbin-table <i>Text</i> , 
				    dustbin-view <i>Text</i> ) : <i>Integer</i><hr>

Changes to src/gaiageo/gg_xml.c.

434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
...
486
487
488
489
490
491
492


493
494
495
496
497
498
499
....
1448
1449
1450
1451
1452
1453
1454













































































































































1455
1456
1457
1458
1459
1460
1461
....
1467
1468
1469
1470
1471
1472
1473

1474
1475
1476
1477
1478
1479
1480
....
1607
1608
1609
1610
1611
1612
1613
1614

1615
1616
1617
1618
1619
1620
1621
1622


1623
1624
1625
1626
1627
1628
1629
....
1684
1685
1686
1687
1688
1689
1690


1691
1692
1693
1694
1695
1696
1697
....
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
....
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
....
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
....
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
....
3035
3036
3037
3038
3039
3040
3041
















3042
3043
3044
3045
3046
3047
3048
....
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
	  node = node->next;
      }
}

static void
sniff_payload (xmlDocPtr xml_doc, int *is_iso_metadata,
	       int *is_sld_se_vector_style, int *is_sld_se_raster_style,
	       int *is_sld_style, int *is_svg, int *is_gpx)
{
/* sniffing the payload type */
    xmlNodePtr root = xmlDocGetRootElement (xml_doc);
    *is_iso_metadata = 0;
    *is_sld_se_vector_style = 0;
    *is_sld_se_raster_style = 0;
    *is_svg = 0;
................................................................................
		  }
		*is_sld_style = 1;
	    }
	  if (strcmp (name, "svg") == 0)
	      *is_svg = 1;
	  if (strcmp (name, "gpx") == 0)
	      *is_gpx = 1;


      }
}

static void
find_iso_ids (xmlNodePtr node, const char *name, char **string, int *open_tag,
	      int *char_string, int *count)
{
................................................................................
	      || strcmp (xname, "RasterSymbolizer") == 0)
	      style = 1;
      }
    find_sld_se_abstract (root, &string, &style, &rule);
    if (string)
	*abstract = string;
}














































































































































GAIAGEO_DECLARE void
gaiaXmlToBlob (const void *p_cache, const unsigned char *xml, int xml_len,
	       int compressed, const char *schemaURI, unsigned char **result,
	       int *size, char **parsing_errors,
	       char **schema_validation_errors)
{
................................................................................
    xmlSchemaValidCtxtPtr valid_ctxt;
    int is_iso_metadata = 0;
    int is_sld_se_vector_style = 0;
    int is_sld_se_raster_style = 0;
    int is_sld_style = 0;
    int is_svg = 0;
    int is_gpx = 0;

    int len;
    int zip_len;
    short uri_len = 0;
    short fileid_len = 0;
    short parentid_len = 0;
    short name_len = 0;
    short title_len = 0;
................................................................................
		return;
	    }
	  xmlSchemaFreeValidCtxt (valid_ctxt);
      }

/* testing for special cases: ISO Metadata, SLD/SE Styles and SVG */
    sniff_payload (xml_doc, &is_iso_metadata, &is_sld_se_vector_style,
		   &is_sld_se_raster_style, &is_sld_style, &is_svg, &is_gpx);

    if (is_iso_metadata)
	retrieve_iso_identifiers (xml_doc, &fileIdentifier,
				  &parentIdentifier, &title, &abstract,
				  &geometry, &geometry_len);
    if (is_sld_style)
	retrieve_sld_identifiers (xml_doc, &name, &title, &abstract);
    else if (is_sld_se_vector_style || is_sld_se_raster_style)
	retrieve_sld_se_identifiers (xml_doc, &name, &title, &abstract);


    xmlFreeDoc (xml_doc);

    if (compressed)
      {
	  /* compressing the XML payload */
	  uLong zLen = compressBound (xml_len);
	  zip_buf = malloc (zLen);
................................................................................
	flags |= GAIA_XML_SLD_SE_RASTER_STYLE;
    if (is_sld_style)
	flags |= GAIA_XML_SLD_STYLE;
    if (is_svg)
	flags |= GAIA_XML_SVG;
    if (is_gpx)
	flags |= GAIA_XML_GPX;


    *(buf + 1) = flags;		/* XmlBLOB flags */
    *(buf + 2) = GAIA_XML_HEADER;	/* HEADER signature */
    gaiaExport32 (buf + 3, xml_len, 1, endian_arch);	/* the uncompressed XMLDocument size */
    gaiaExport32 (buf + 7, zip_len, 1, endian_arch);	/* the compressed XMLDocument size */
    gaiaExport16 (buf + 11, uri_len, 1, endian_arch);	/* the SchemaURI length in bytes */
    *(buf + 13) = GAIA_XML_SCHEMA;	/* SCHEMA signature */
    ptr = buf + 14;
................................................................................
}

GAIAGEO_DECLARE char *
gaiaXmlTextFromBlob (const unsigned char *blob, int blob_size, int indent)
{
/* attempting to extract an XMLDocument from within an XmlBLOB buffer */

#ifndef OMIT_ICONV	/* only if ICONV is supported */
    int compressed = 0;
    int little_endian = 0;
    unsigned char flag;
    const unsigned char *ptr;
    int xml_len;
    int zip_len;
    short uri_len;
................................................................................
    if (out)
      {
	  xmlSetGenericErrorFunc ((void *) stderr, NULL);
	  return (char *) out;
      }
    xmlSetGenericErrorFunc ((void *) stderr, NULL);
    return NULL;
    
#else
	if (blob != NULL && blob_size == 0 && indent == 0)
	blob = NULL;	/* silencing stupid compiler warnings */
#endif
	return NULL;
}

GAIAGEO_DECLARE void
gaiaXmlFromBlob (const unsigned char *blob, int blob_size, int indent,
		 unsigned char **result, int *res_size)
{
/* attempting to extract an XMLDocument from within an XmlBLOB buffer */
................................................................................
    int iso_metadata = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_ISO_METADATA) == GAIA_XML_ISO_METADATA)
	iso_metadata = 1;
    return iso_metadata;
}

GAIAGEO_DECLARE int
gaiaIsSldSeVectorStyleXmlBlob (const unsigned char *blob, int blob_size)
{
................................................................................
    int sld_se_style = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_SLD_SE_VECTOR_STYLE) == GAIA_XML_SLD_SE_VECTOR_STYLE)
	sld_se_style = 1;
    return sld_se_style;
}

GAIAGEO_DECLARE int
gaiaIsSldSeRasterStyleXmlBlob (const unsigned char *blob, int blob_size)
{
................................................................................
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_SLD_STYLE) == GAIA_XML_SLD_STYLE)
	sld_style = 1;
    return sld_style;
}

















GAIAGEO_DECLARE int
gaiaIsSvgXmlBlob (const unsigned char *blob, int blob_size)
{
/* Checks if a valid XmlBLOB buffer does actually contains an SVG image or not */
    int svg = 0;
    unsigned char flag;
................................................................................
    int gpx = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_GPX) == GAIA_XML_GPX)
	gpx = 1;
    return gpx;
}

GAIAGEO_DECLARE int
gaiaXmlBlobGetDocumentSize (const unsigned char *blob, int blob_size)
{







|







 







>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







|
>








>
>







 







>
>







 







|







 







|

|
|

|







 







|







 







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
...
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
....
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
....
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
....
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
....
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
....
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
....
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
....
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
....
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
....
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
....
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
	  node = node->next;
      }
}

static void
sniff_payload (xmlDocPtr xml_doc, int *is_iso_metadata,
	       int *is_sld_se_vector_style, int *is_sld_se_raster_style,
	       int *is_sld_style, int *is_svg, int *is_gpx, int *is_map_config)
{
/* sniffing the payload type */
    xmlNodePtr root = xmlDocGetRootElement (xml_doc);
    *is_iso_metadata = 0;
    *is_sld_se_vector_style = 0;
    *is_sld_se_raster_style = 0;
    *is_svg = 0;
................................................................................
		  }
		*is_sld_style = 1;
	    }
	  if (strcmp (name, "svg") == 0)
	      *is_svg = 1;
	  if (strcmp (name, "gpx") == 0)
	      *is_gpx = 1;
	  if (strcmp (name, "RL2MapConfig") == 0)
	      *is_map_config = 1;
      }
}

static void
find_iso_ids (xmlNodePtr node, const char *name, char **string, int *open_tag,
	      int *char_string, int *count)
{
................................................................................
	      || strcmp (xname, "RasterSymbolizer") == 0)
	      style = 1;
      }
    find_sld_se_abstract (root, &string, &style, &rule);
    if (string)
	*abstract = string;
}

static void
find_map_config_name (xmlNodePtr node, char **string)
{
/* recursively scanning the DOM tree [name] */
    while (node)
      {
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
		if (strcmp (name, "Name") == 0)
		  {
		      xmlNodePtr child = node->children;
		      if (child)
			{
			    if (child->type == XML_TEXT_NODE)
			      {
				  int len;
				  const char *value =
				      (const char *) (child->content);
				  len = strlen (value);
				  if (*string != NULL)
				      free (*string);
				  *string = malloc (len + 1);
				  strcpy (*string, value);
			      }
			}
		  }
	    }
	  node = node->next;
      }
}

static void
find_map_config_title (xmlNodePtr node, char **string)
{
/* recursively scanning the DOM tree [title] */
    while (node)
      {
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
		if (strcmp (name, "Title") == 0)
		  {
		      xmlNodePtr child = node->children;
		      if (child)
			{
			    if (child->type == XML_TEXT_NODE)
			      {
				  int len;
				  const char *value =
				      (const char *) (child->content);
				  len = strlen (value);
				  if (*string != NULL)
				      free (*string);
				  *string = malloc (len + 1);
				  strcpy (*string, value);
			      }
			}
		  }
		if (strcmp (name, "Description") == 0)
		    find_map_config_title (node->children, string);
	    }
	  node = node->next;
      }
}

static void
find_map_config_abstract (xmlNodePtr node, char **string)
{
/* recursively scanning the DOM tree [abstract] */
    while (node)
      {
	  if (node->type == XML_ELEMENT_NODE)
	    {
		const char *name = (const char *) (node->name);
		if (strcmp (name, "Abstract") == 0)
		  {
		      xmlNodePtr child = node->children;
		      if (child)
			{
			    if (child->type == XML_TEXT_NODE)
			      {
				  int len;
				  const char *value =
				      (const char *) (child->content);
				  len = strlen (value);
				  if (*string != NULL)
				      free (*string);
				  *string = malloc (len + 1);
				  strcpy (*string, value);
			      }
			}
		  }
		if (strcmp (name, "Description") == 0)
		    find_map_config_abstract (node->children, string);
	    }
	  node = node->next;
      }
}

static void
retrieve_map_config_identifiers (xmlDocPtr xml_doc, char **name, char **title,
			  char **abstract)
{
/*
/ attempting to retrieve the Name, Title and Abstract items 
/ from a Map Config document
*/
    xmlNodePtr root = xmlDocGetRootElement (xml_doc);
    char *string;
    const char *xname = (const char *) (root->name);

    *name = NULL;
    *title = NULL;
    *abstract = NULL;

    if (xname != NULL)
      {
	  if (strcmp (xname, "RL2MapConfig") != 0)
	      return;
      }

/* attempting to retrieve the Name item */
    string = NULL;
    find_map_config_name (root->children, &string);
    if (string)
	*name = string;

/* attempting to retrieve the Title item */
    string = NULL;
    find_map_config_title (root->children, &string);
    if (string)
	*title = string;

/* attempting to retrieve the Abstract item */
    string = NULL;
    find_map_config_abstract (root->children, &string);
    if (string)
	*abstract = string;
}

GAIAGEO_DECLARE void
gaiaXmlToBlob (const void *p_cache, const unsigned char *xml, int xml_len,
	       int compressed, const char *schemaURI, unsigned char **result,
	       int *size, char **parsing_errors,
	       char **schema_validation_errors)
{
................................................................................
    xmlSchemaValidCtxtPtr valid_ctxt;
    int is_iso_metadata = 0;
    int is_sld_se_vector_style = 0;
    int is_sld_se_raster_style = 0;
    int is_sld_style = 0;
    int is_svg = 0;
    int is_gpx = 0;
    int is_map_config = 0;
    int len;
    int zip_len;
    short uri_len = 0;
    short fileid_len = 0;
    short parentid_len = 0;
    short name_len = 0;
    short title_len = 0;
................................................................................
		return;
	    }
	  xmlSchemaFreeValidCtxt (valid_ctxt);
      }

/* testing for special cases: ISO Metadata, SLD/SE Styles and SVG */
    sniff_payload (xml_doc, &is_iso_metadata, &is_sld_se_vector_style,
		   &is_sld_se_raster_style, &is_sld_style, &is_svg, &is_gpx,
		   &is_map_config);
    if (is_iso_metadata)
	retrieve_iso_identifiers (xml_doc, &fileIdentifier,
				  &parentIdentifier, &title, &abstract,
				  &geometry, &geometry_len);
    if (is_sld_style)
	retrieve_sld_identifiers (xml_doc, &name, &title, &abstract);
    else if (is_sld_se_vector_style || is_sld_se_raster_style)
	retrieve_sld_se_identifiers (xml_doc, &name, &title, &abstract);
	else if (is_map_config)
	retrieve_map_config_identifiers(xml_doc, &name, &title, &abstract);
    xmlFreeDoc (xml_doc);

    if (compressed)
      {
	  /* compressing the XML payload */
	  uLong zLen = compressBound (xml_len);
	  zip_buf = malloc (zLen);
................................................................................
	flags |= GAIA_XML_SLD_SE_RASTER_STYLE;
    if (is_sld_style)
	flags |= GAIA_XML_SLD_STYLE;
    if (is_svg)
	flags |= GAIA_XML_SVG;
    if (is_gpx)
	flags |= GAIA_XML_GPX;
    if (is_map_config)
	flags |= GAIA_XML_MAP_CONFIG;
    *(buf + 1) = flags;		/* XmlBLOB flags */
    *(buf + 2) = GAIA_XML_HEADER;	/* HEADER signature */
    gaiaExport32 (buf + 3, xml_len, 1, endian_arch);	/* the uncompressed XMLDocument size */
    gaiaExport32 (buf + 7, zip_len, 1, endian_arch);	/* the compressed XMLDocument size */
    gaiaExport16 (buf + 11, uri_len, 1, endian_arch);	/* the SchemaURI length in bytes */
    *(buf + 13) = GAIA_XML_SCHEMA;	/* SCHEMA signature */
    ptr = buf + 14;
................................................................................
}

GAIAGEO_DECLARE char *
gaiaXmlTextFromBlob (const unsigned char *blob, int blob_size, int indent)
{
/* attempting to extract an XMLDocument from within an XmlBLOB buffer */

#ifndef OMIT_ICONV		/* only if ICONV is supported */
    int compressed = 0;
    int little_endian = 0;
    unsigned char flag;
    const unsigned char *ptr;
    int xml_len;
    int zip_len;
    short uri_len;
................................................................................
    if (out)
      {
	  xmlSetGenericErrorFunc ((void *) stderr, NULL);
	  return (char *) out;
      }
    xmlSetGenericErrorFunc ((void *) stderr, NULL);
    return NULL;

#else
    if (blob != NULL && blob_size == 0 && indent == 0)
	blob = NULL;		/* silencing stupid compiler warnings */
#endif
    return NULL;
}

GAIAGEO_DECLARE void
gaiaXmlFromBlob (const unsigned char *blob, int blob_size, int indent,
		 unsigned char **result, int *res_size)
{
/* attempting to extract an XMLDocument from within an XmlBLOB buffer */
................................................................................
    int iso_metadata = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if (((flag & GAIA_XML_ISO_METADATA) == GAIA_XML_ISO_METADATA) && ((flag & GAIA_XML_MAP_CONFIG) != GAIA_XML_MAP_CONFIG))
	iso_metadata = 1;
    return iso_metadata;
}

GAIAGEO_DECLARE int
gaiaIsSldSeVectorStyleXmlBlob (const unsigned char *blob, int blob_size)
{
................................................................................
    int sld_se_style = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if (((flag & GAIA_XML_SLD_SE_VECTOR_STYLE) == GAIA_XML_SLD_SE_VECTOR_STYLE) && ((flag & GAIA_XML_SLD_STYLE) != GAIA_XML_SLD_STYLE))
	sld_se_style = 1;
    return sld_se_style;
}

GAIAGEO_DECLARE int
gaiaIsSldSeRasterStyleXmlBlob (const unsigned char *blob, int blob_size)
{
................................................................................
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_SLD_STYLE) == GAIA_XML_SLD_STYLE)
	sld_style = 1;
    return sld_style;
}

GAIAGEO_DECLARE int
gaiaIsMapConfigXmlBlob (const unsigned char *blob, int blob_size)
{
/* Checks if a valid XmlBLOB buffer does actually contains a MapConfig or not */
    int sld_style = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if ((flag & GAIA_XML_MAP_CONFIG) == GAIA_XML_MAP_CONFIG)
	sld_style = 1;
    return sld_style;
}

GAIAGEO_DECLARE int
gaiaIsSvgXmlBlob (const unsigned char *blob, int blob_size)
{
/* Checks if a valid XmlBLOB buffer does actually contains an SVG image or not */
    int svg = 0;
    unsigned char flag;
................................................................................
    int gpx = 0;
    unsigned char flag;

/* validity check */
    if (!gaiaIsValidXmlBlob (blob, blob_size))
	return -1;		/* cannot be an XmlBLOB */
    flag = *(blob + 1);
    if (((flag & GAIA_XML_GPX) == GAIA_XML_GPX) && ((flag & GAIA_XML_MAP_CONFIG) != GAIA_XML_MAP_CONFIG))
	gpx = 1;
    return gpx;
}

GAIAGEO_DECLARE int
gaiaXmlBlobGetDocumentSize (const unsigned char *blob, int blob_size)
{

Changes to src/headers/spatialite/gg_xml.h.

104
105
106
107
108
109
110


111
112
113
114
115
116
117
...
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
...
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
...
298
299
300
301
302
303
304
305
306
307
308
309

















310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
...
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
#define GAIA_XML_SLD_SE_VECTOR_STYLE	0x40
/** XmlBLOB FLAG - SLD STYLE bitmask */
#define GAIA_XML_SLD_STYLE		0x48
/** XmlBLOB FLAG - SVG bitmask */
#define GAIA_XML_SVG			0x20
/** XmlBLOB FLAG - GPX bitmask */
#define GAIA_XML_GPX			0x08




/* function prototypes */

#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#ifdef ENABLE_LIBXML2		/* LIBXML2 enabled: supporting XML documents */
#endif
................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE

 \sa gaiaIsCompressedXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsValidXmlBlob (const unsigned char *blob,
					    int size);

/**
 Checks if a valid XmlBLOB buffer is compressed or not

................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsCompressedXmlBlob (const unsigned char *blob,
						 int size);

/**
 Checks if a valid XmlBLOB buffer does contain an ISO Metadata or not

................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsIsoMetadataXmlBlob (const unsigned char *blob,
						  int size);

/**
 Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not

................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the
 Raster type; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSldSeRasterStyleXmlBlob (const unsigned char
						       *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain an SLD Style or not

................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the
 SLD type; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSldStyleXmlBlob (const unsigned char
					       *blob, int size);


















/**
 Checks if a valid XmlBLOB buffer does contain an SVG Symbol or not

 \param blob pointer to the XmlBLOB buffer.
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsGpxXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSvgXmlBlob (const unsigned char *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain a GPX document or not

 \param blob pointer to the XmlBLOB buffer.
................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSvgXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsGpxXmlBlob (const unsigned char *blob, int size);

/**
 Return another XmlBLOB buffer compressed / uncompressed

 \param blob pointer to the input XmlBLOB buffer.
................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB but not schema-validated; 
  -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSvgXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob,
 gaiaIsSldStyleXmlBlob 
 */
    GAIAGEO_DECLARE int gaiaIsSchemaValidatedXmlBlob (const unsigned char
						      *blob, int size);

/**
 Return the XMLDocument size (in bytes) from a valid XmlBLOB buffer








>
>







 







|







 







|







 







|







 







|







 







|




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>











|







 







|







 







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
...
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
...
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
...
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
#define GAIA_XML_SLD_SE_VECTOR_STYLE	0x40
/** XmlBLOB FLAG - SLD STYLE bitmask */
#define GAIA_XML_SLD_STYLE		0x48
/** XmlBLOB FLAG - SVG bitmask */
#define GAIA_XML_SVG			0x20
/** XmlBLOB FLAG - GPX bitmask */
#define GAIA_XML_GPX			0x08
/** XmlBLOB FLAG - MapConfig bitmask */
#define GAIA_XML_MAP_CONFIG		0x88


/* function prototypes */

#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#ifdef ENABLE_LIBXML2		/* LIBXML2 enabled: supporting XML documents */
#endif
................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE

 \sa gaiaIsCompressedXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsValidXmlBlob (const unsigned char *blob,
					    int size);

/**
 Checks if a valid XmlBLOB buffer is compressed or not

................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsIsoMetadataXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsCompressedXmlBlob (const unsigned char *blob,
						 int size);

/**
 Checks if a valid XmlBLOB buffer does contain an ISO Metadata or not

................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsSldSeVectorStyleXmlBlob, 
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsIsoMetadataXmlBlob (const unsigned char *blob,
						  int size);

/**
 Checks if a valid XmlBLOB buffer does contain an SLD/SE Style or not

................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the
 Raster type; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSldSeRasterStyleXmlBlob (const unsigned char
						       *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain an SLD Style or not

................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the
 SLD type; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSldStyleXmlBlob (const unsigned char
					       *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain a MapConfig or not

 \param blob pointer to the XmlBLOB buffer.
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB of the
 MapConfig type; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterXmlBlob,
 gaiaIsSvgXmlBlob, gaiaIsGpxXmlBlob, gaiaIsSldStyleXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsMapConfigXmlBlob (const unsigned char
					       *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain an SVG Symbol or not

 \param blob pointer to the XmlBLOB buffer.
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsGpxXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsSvgXmlBlob (const unsigned char *blob, int size);

/**
 Checks if a valid XmlBLOB buffer does contain a GPX document or not

 \param blob pointer to the XmlBLOB buffer.
................................................................................
 \param size XmlBLOB's size (in bytes).

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB; -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSchemaValidatedXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldStyleXmlBlob,
 gaiaIsSldSeRasterStyleXmlBlob, gaiaIsSvgXmlBlob, gaiaIsMapConfigXmlBlob
 */
    GAIAGEO_DECLARE int gaiaIsGpxXmlBlob (const unsigned char *blob, int size);

/**
 Return another XmlBLOB buffer compressed / uncompressed

 \param blob pointer to the input XmlBLOB buffer.
................................................................................

 \return TRUE or FALSE if the BLOB actually is a valid XmlBLOB but not schema-validated; 
  -1 in any other case.

 \sa gaiaIsValidXmlBlob, gaiaIsSvgXmlBlob, 
 gaiaIsCompressedXmlBlob, gaiaIsIsoMetadataXmlBlob, 
 gaiaIsSldSeVectorStyleXmlBlob, gaiaIsSldSeRasterStyleXmlBlob,
 gaiaIsSldStyleXmlBlob, gaiaIsMapConfigXmlBlob 
 */
    GAIAGEO_DECLARE int gaiaIsSchemaValidatedXmlBlob (const unsigned char
						      *blob, int size);

/**
 Return the XMLDocument size (in bytes) from a valid XmlBLOB buffer

Changes to src/headers/spatialite_private.h.

653
654
655
656
657
658
659













660
661
662
663
664
665
666

    SPATIALITE_PRIVATE int unregister_styled_group_style (void *p_sqlite,
							  const char
							  *group_name,
							  int style_id,
							  const char
							  *style_name);














    SPATIALITE_PRIVATE int createIsoMetadataTables (void *p_sqlite,
						    int relaxed);

    SPATIALITE_PRIVATE int get_iso_metadata_id (void *p_sqlite,
						const char *fileIdentifier,
						void *p_id);







>
>
>
>
>
>
>
>
>
>
>
>
>







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679

    SPATIALITE_PRIVATE int unregister_styled_group_style (void *p_sqlite,
							  const char
							  *group_name,
							  int style_id,
							  const char
							  *style_name);

    SPATIALITE_PRIVATE int register_map_configuration (void *p_sqlite,
						  const unsigned char *p_blob,
						  int n_bytes);

    SPATIALITE_PRIVATE int unregister_map_configuration (void *p_sqlite,
						    int id,
						    const char *name);

    SPATIALITE_PRIVATE int reload_map_configuration (void *p_sqlite, int id,
						const char *name,
						const unsigned char *p_blob,
						int n_bytes);

    SPATIALITE_PRIVATE int createIsoMetadataTables (void *p_sqlite,
						    int relaxed);

    SPATIALITE_PRIVATE int get_iso_metadata_id (void *p_sqlite,
						const char *fileIdentifier,
						void *p_id);

Changes to src/spatialite/create_routing.c.

1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
			}
		      else
			{
			    sqlite3_bind_null (stmt_ins_links, 4);
			    sqlite3_bind_text (stmt_ins_links, 5, to,
					       strlen (to), SQLITE_STATIC);
			}
		      sqlite3_bind_double (stmt_ins_links, 6, length);
		      sqlite3_bind_double (stmt_ins_links, 7, cost);
		      ret = sqlite3_step (stmt_ins_links);
		      if (ret == SQLITE_DONE || ret == SQLITE_ROW)
			  ;
		      else
			{
			    char *msg =
				sqlite3_mprintf







|
<







1290
1291
1292
1293
1294
1295
1296
1297

1298
1299
1300
1301
1302
1303
1304
			}
		      else
			{
			    sqlite3_bind_null (stmt_ins_links, 4);
			    sqlite3_bind_text (stmt_ins_links, 5, to,
					       strlen (to), SQLITE_STATIC);
			}
		      sqlite3_bind_double (stmt_ins_links, 6, cost);

		      ret = sqlite3_step (stmt_ins_links);
		      if (ret == SQLITE_DONE || ret == SQLITE_ROW)
			  ;
		      else
			{
			    char *msg =
				sqlite3_mprintf

Changes to src/spatialite/extra_tables.c.

741
742
743
744
745
746
747




























748
749
750
751
752
753
754
....
2147
2148
2149
2150
2151
2152
2153





















































































































































2154
2155
2156
2157
2158
2159
2160
....
4805
4806
4807
4808
4809
4810
4811






4812
4813
4814
4815
4816
4817
4818
		  }
	    }
      }
    sqlite3_finalize (stmt_in);
    sqlite3_finalize (stmt_out);
    return 1;
}





























static int
check_raster_coverages (sqlite3 * sqlite)
{
/* checking if the "raster_coverages" table already exists */
    int exists = 0;
    char *sql_statement;
................................................................................
    sqlite3 *sqlite = p_sqlite;

    drop_raster_coverages_triggers (sqlite);
    if (!create_raster_coverages_triggers (sqlite))
	return 0;
    return 1;
}






















































































































































static int
check_if_coverage_exists (sqlite3 * sqlite, const char *db_prefix,
			  const char *coverage)
{
/* checking if a Coverage table already exists */
    int exists = 0;
................................................................................
	  do_create_topologies (sqlite);
	  do_create_networks (sqlite);
	  /* creating the main VectorCoverages table as well */
	  if (!create_vector_coverages (sqlite))
	      goto error;
      }
#endif /* end TOPOLOGY conditionals */






    if (!create_external_graphics (sqlite))
	goto error;
    if (!create_fonts (sqlite))
	goto error;
    if (!create_vector_styles (sqlite, relaxed))
	goto error;
    if (!create_raster_styles (sqlite, relaxed))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>







741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
....
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
....
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
		  }
	    }
      }
    sqlite3_finalize (stmt_in);
    sqlite3_finalize (stmt_out);
    return 1;
}

static int
check_rl2map_configurations (sqlite3 * sqlite)
{
/* checking if the "rl2map_configurations" table already exists */
    int exists = 0;
    char *sql_statement;
    char *errMsg = NULL;
    int ret;
    char **results;
    int rows;
    int columns;
    int i;
    sql_statement = "SELECT name FROM sqlite_master WHERE type = 'table' "
	"AND Upper(name) = Upper('rl2map_configurations')";
    ret =
	sqlite3_get_table (sqlite, sql_statement, &results, &rows, &columns,
			   &errMsg);
    if (ret != SQLITE_OK)
      {
	  sqlite3_free (errMsg);
	  return 0;
      }
    for (i = 1; i <= rows; i++)
	exists = 1;
    sqlite3_free_table (results);
    return exists;
}

static int
check_raster_coverages (sqlite3 * sqlite)
{
/* checking if the "raster_coverages" table already exists */
    int exists = 0;
    char *sql_statement;
................................................................................
    sqlite3 *sqlite = p_sqlite;

    drop_raster_coverages_triggers (sqlite);
    if (!create_raster_coverages_triggers (sqlite))
	return 0;
    return 1;
}

static int
create_rl2map_configurations_triggers (sqlite3 * sqlite, int relaxed)
{
/* creating the rl2map_configurations triggers */
    char *sql;
    int ret;
    char **results;
    int rows;
    int columns;
    int i;
    char *err_msg = NULL;
    int ok_rl2map_config = 0;

/* checking for existing tables */
    sql =
	"SELECT tbl_name FROM sqlite_master WHERE type = 'table' AND tbl_name = 'rl2map_configurations'";
    ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &err_msg);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("SQL error: %s\n", err_msg);
	  sqlite3_free (err_msg);
	  return 0;
      }
    for (i = 1; i <= rows; i++)
      {
	  const char *name = results[(i * columns) + 0];
	  if (strcasecmp (name, "rl2map_configurations") == 0)
	      ok_rl2map_config = 1;
      }
    sqlite3_free_table (results);

    if (ok_rl2map_config)
      {
	  /* creating the rl2map_configurations triggers */
	  if (relaxed == 0)
	    {
		/* strong trigger - imposing XML schema validation */
		sql = "CREATE TRIGGER rl2map_config_insert\n"
		    "BEFORE INSERT ON 'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
		    "SELECT RAISE(ABORT,'insert on rl2map_configurations violates constraint: "
		    "not a valid RL2 Map Configuration')\n"
		    "WHERE XB_IsMapConfig(NEW.config) <> 1;\n"
		    "SELECT RAISE(ABORT,'insert on rl2map_configurations violates constraint: "
		    "not an XML Schema Validated RL2 Map Configuration')\n"
		    "WHERE XB_IsSchemaValidated(NEW.config) <> 1;\nEND";
	    }
	  else
	    {
		/* relaxed trigger - not imposing XML schema validation */
		sql = "CREATE TRIGGER rl2map_config_insert\n"
		    "BEFORE INSERT ON 'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
		    "SELECT RAISE(ABORT,'insert on rl2map_configurations violates constraint: "
		    "not a valid RL2 Map Configuration')\n"
		    "WHERE XB_IsMapConfig(NEW.config) <> 1;\nEND";
	    }
	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("SQL error: %s\n", err_msg);
		sqlite3_free (err_msg);
		return 0;
	    }
	  if (relaxed == 0)
	    {
		/* strong trigger - imposing XML schema validation */
		sql = "CREATE TRIGGER rl2map_config_update\n"
		    "BEFORE UPDATE ON 'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
		    "SELECT RAISE(ABORT,'update on rl2map_configurations violates constraint: "
		    "not a valid RL2 Map Configuration')\n"
		    "WHERE XB_IsMapConfig(NEW.config) <> 1;\n"
		    "SELECT RAISE(ABORT,'update on rl2map_configurations violates constraint: "
		    "not an XML Schema Validated RL2 Map Configuration')\n"
		    "WHERE XB_IsSchemaValidated(NEW.config) <> 1;\nEND";
	    }
	  else
	    {
		/* relaxed trigger - not imposing XML schema validation */
		sql = "CREATE TRIGGER rl2map_config_update\n"
		    "BEFORE UPDATE ON 'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
		    "SELECT RAISE(ABORT,'update on rl2map_configurations violates constraint: "
		    "not a valid RL2 Map Configuration')\n"
		    "WHERE XB_IsMapConfig(NEW.config) <> 1;\nEND";
	    }
	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("SQL error: %s\n", err_msg);
		sqlite3_free (err_msg);
		return 0;
	    }
/* automatically setting the style_name after inserting */
	  sql = "CREATE TRIGGER rl2map_config_name_ins\n"
	      "AFTER INSERT ON 'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
	      "UPDATE rl2map_configurations "
	      "SET name = XB_GetName(NEW.config) "
	      "WHERE id = NEW.id;\nEND";
	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("SQL error: %s\n", err_msg);
		sqlite3_free (err_msg);
		return 0;
	    }
/* automatically setting the style_name after updating */
	  sql = "CREATE TRIGGER rl2map_config_name_upd\n"
	      "AFTER UPDATE OF config ON "
	      "'rl2map_configurations'\nFOR EACH ROW BEGIN\n"
	      "UPDATE rl2map_configurations "
	      "SET name = XB_GetName(NEW.config) "
	      "WHERE id = NEW.id;\nEND";
	  ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("SQL error: %s\n", err_msg);
		sqlite3_free (err_msg);
		return 0;
	    }
      }
    return 1;
}

static int
create_rl2map_configurations (sqlite3 * sqlite, int relaxed)
{
/* creating the "rl2map_configurations" table */
    char *sql;
    int ret;
    char *err_msg = NULL;
    
    sql = "CREATE TABLE rl2map_configurations (\n"
	"id INTEGER PRIMARY KEY AUTOINCREMENT,\n"
	"name TEXT NOT NULL DEFAULT 'missing_name' UNIQUE,\n"
	"title TEXT NOT NULL DEFAULT '*** missing Title ***',\n"
	"abstract TEXT NOT NULL DEFAULT '*** missing Abstract ***',\n"
	"config BLOB NOT NULL)";
    ret = sqlite3_exec (sqlite, sql, NULL, NULL, &err_msg);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("CREATE TABLE 'rl2map_configurations' error: %s\n", err_msg);
	  sqlite3_free (err_msg);
	  return 0;
      }
      
/* creating the Triggers */
    if (!create_rl2map_configurations_triggers (sqlite, relaxed))
	return 0;
    return 1;
}

static int
check_if_coverage_exists (sqlite3 * sqlite, const char *db_prefix,
			  const char *coverage)
{
/* checking if a Coverage table already exists */
    int exists = 0;
................................................................................
	  do_create_topologies (sqlite);
	  do_create_networks (sqlite);
	  /* creating the main VectorCoverages table as well */
	  if (!create_vector_coverages (sqlite))
	      goto error;
      }
#endif /* end TOPOLOGY conditionals */
if (!check_rl2map_configurations(sqlite))
{
	/* creating the rl2map_configurations table as well */
	if (!create_rl2map_configurations(sqlite, relaxed))
	goto error;
}
    if (!create_external_graphics (sqlite))
	goto error;
    if (!create_fonts (sqlite))
	goto error;
    if (!create_vector_styles (sqlite, relaxed))
	goto error;
    if (!create_raster_styles (sqlite, relaxed))

Changes to src/spatialite/se_helpers.c.

315
316
317
318
319
320
321

























































































































































































































































































































































322
323
324
325
326
327
328
	      count = sqlite3_column_int (stmt, 0);
      }
    sqlite3_finalize (stmt);
    if (count != 0)
	return 1;
    return 0;
}


























































































































































































































































































































































SPATIALITE_PRIVATE int
register_vector_style (void *p_sqlite, const unsigned char *p_blob, int n_bytes)
{
/* auxiliary function: inserts a Vector Style definition */
    sqlite3 *sqlite = (sqlite3 *) p_sqlite;
    int ret;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
	      count = sqlite3_column_int (stmt, 0);
      }
    sqlite3_finalize (stmt);
    if (count != 0)
	return 1;
    return 0;
}

static int
map_configuration_causes_duplicate_name (sqlite3 * sqlite, sqlite3_int64 id,
					 const unsigned char *p_blob,
					 int n_bytes)
{
/* auxiliary function: checks for an eventual duplicate name */
    int count = 0;
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;

    sql = "SELECT Count(*) FROM rl2map_configurations "
	"WHERE Lower(name) = Lower(XB_GetName(?)) AND id <> ?";
    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("MapConfigurations duplicate Name: \"%s\"\n",
			sqlite3_errmsg (sqlite));
	  return 0;
      }
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);
    sqlite3_bind_blob (stmt, 1, p_blob, n_bytes, SQLITE_STATIC);
    sqlite3_bind_int64 (stmt, 2, id);
    while (1)
      {
	  /* scrolling the result set rows */
	  ret = sqlite3_step (stmt);
	  if (ret == SQLITE_DONE)
	      break;		/* end of result set */
	  if (ret == SQLITE_ROW)
	      count = sqlite3_column_int (stmt, 0);
      }
    sqlite3_finalize (stmt);
    if (count != 0)
	return 1;
    return 0;
}

SPATIALITE_PRIVATE int
register_map_configuration (void *p_sqlite, const unsigned char *p_blob,
			    int n_bytes)
{
/* auxiliary function: inserts a Map Configuration definition */
    sqlite3 *sqlite = (sqlite3 *) p_sqlite;
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;
    char *name;
    char *title;
    char *abstract;

    if (p_blob != NULL && n_bytes > 0)
      {
	  /* attempting to insert the Map Configuration */
	  if (map_configuration_causes_duplicate_name
	      (sqlite, -1, p_blob, n_bytes))
	      return 0;
	  sql = "INSERT INTO rl2map_configurations "
	      "(id, name, title, abstract, config) VALUES (NULL, ?, ?, ?, ?)";
	  ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("registerMapConfigurations: \"%s\"\n",
			      sqlite3_errmsg (sqlite));
		return 0;
	    }
	  name = gaiaXmlBlobGetName (p_blob, n_bytes);
	  title = gaiaXmlBlobGetTitle (p_blob, n_bytes);
	  abstract = gaiaXmlBlobGetAbstract (p_blob, n_bytes);
	  sqlite3_reset (stmt);
	  sqlite3_clear_bindings (stmt);
	  if (name == NULL)
	      sqlite3_bind_null (stmt, 1);
	  else
	      sqlite3_bind_text (stmt, 1, name, strlen (name), SQLITE_STATIC);
	  if (title == NULL)
	      sqlite3_bind_null (stmt, 2);
	  else
	      sqlite3_bind_text (stmt, 2, title, strlen (title), SQLITE_STATIC);
	  if (abstract == NULL)
	      sqlite3_bind_null (stmt, 3);
	  else
	      sqlite3_bind_text (stmt, 3, abstract, strlen (abstract),
				 SQLITE_STATIC);
	  sqlite3_bind_blob (stmt, 4, p_blob, n_bytes, SQLITE_STATIC);
	  ret = sqlite3_step (stmt);
	  if (ret == SQLITE_DONE || ret == SQLITE_ROW)
	      ;
	  else
	    {
		spatialite_e ("registerMapConfigurations() error: \"%s\"\n",
			      sqlite3_errmsg (sqlite));
		sqlite3_finalize (stmt);
		return 0;
	    }
	  sqlite3_finalize (stmt);
	  return 1;
      }
    else
	return 0;
}

static int
check_map_configuration_by_id (sqlite3 * sqlite, int id)
{
/* checks if a Map Configuration do actually exists - by ID */
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;
    int count = 0;

    sql = "SELECT id FROM rl2map_configurations " "WHERE id = ?";
    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("check MapConfigurations by ID: \"%s\"\n",
			sqlite3_errmsg (sqlite));
	  goto stop;
      }
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);
    sqlite3_bind_int (stmt, 1, id);
    while (1)
      {
	  /* scrolling the result set rows */
	  ret = sqlite3_step (stmt);
	  if (ret == SQLITE_DONE)
	      break;		/* end of result set */
	  if (ret == SQLITE_ROW)
	      count++;
      }
    sqlite3_finalize (stmt);
    if (count == 1)
	return 1;
    return 0;
  stop:
    return 0;
}

static int
check_map_configuration_by_name (sqlite3 * sqlite, const char *name,
				 sqlite3_int64 * id)
{
/* checks if a Map Configuration do actually exists - by name */
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;
    int count = 0;
    sqlite3_int64 xid = 0;

    sql = "SELECT id FROM rl2map_configurations "
	"WHERE Lower(name) = Lower(?)";
    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("check MapConfigurations by Name: \"%s\"\n",
			sqlite3_errmsg (sqlite));
	  goto stop;
      }
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);
    sqlite3_bind_text (stmt, 1, name, strlen (name), SQLITE_STATIC);
    while (1)
      {
	  /* scrolling the result set rows */
	  ret = sqlite3_step (stmt);
	  if (ret == SQLITE_DONE)
	      break;		/* end of result set */
	  if (ret == SQLITE_ROW)
	    {
		xid = sqlite3_column_int64 (stmt, 0);
		count++;
	    }
      }
    sqlite3_finalize (stmt);
    if (count == 1)
      {
	  *id = xid;
	  return 1;
      }
    return 0;
  stop:
    return 0;
}

static int
do_delete_map_configuration (sqlite3 * sqlite, sqlite3_int64 id)
{
/* auxiliary function: really deleting a Map Configuration */
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;
    int retval = 0;
    sql = "DELETE FROM rl2map_configurations WHERE id = ?";
    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
      {
	  spatialite_e ("unregisterMapConfigurations: \"%s\"\n",
			sqlite3_errmsg (sqlite));
	  goto stop;
      }
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);
    sqlite3_bind_int64 (stmt, 1, id);
    ret = sqlite3_step (stmt);
    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
	retval = 1;
    else
	spatialite_e ("unregisterMapConfigurations() error: \"%s\"\n",
		      sqlite3_errmsg (sqlite));
    sqlite3_finalize (stmt);
    return retval;
  stop:
    return 0;
}

SPATIALITE_PRIVATE int
unregister_map_configuration (void *p_sqlite, int xid, const char *name)
{
/* auxiliary function: deletes a Map Configuration definition */
    sqlite3 *sqlite = (sqlite3 *) p_sqlite;
    sqlite3_int64 id;

    if (xid >= 0)
      {
	  /* checking if the Map Configuration do actually exists */
	  if (check_map_configuration_by_id (sqlite, xid))
	      id = xid;
	  else
	      return 0;
	  /* deleting the Map Configuration */
	  return do_delete_map_configuration (sqlite, id);
      }
    else if (name != NULL)
      {
	  /* checking if the Map Configuration do actually exists */
	  if (!check_map_configuration_by_name (sqlite, name, &id))
	      return 0;
	  /* deleting the Vector Style */
	  return do_delete_map_configuration (sqlite, id);
      }
    else
	return 0;
}

static int
do_reload_map_configuration (sqlite3 * sqlite, sqlite3_int64 id,
			     const unsigned char *p_blob, int n_bytes)
{
/* auxiliary function: reloads a Map Configurarion definition */
    int ret;
    const char *sql;
    sqlite3_stmt *stmt;
    char *name;
    char *title;
    char *abstract;

    if (p_blob != NULL && n_bytes > 0)
      {
	  /* attempting to update the Vector Style */
	  sql =
	      "UPDATE rl2map_configurations SET name = ?, title = ?, abstract = ?, config = ? "
	      "WHERE id = ?";
	  ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
	  if (ret != SQLITE_OK)
	    {
		spatialite_e ("reloadMapConfiguration: \"%s\"\n",
			      sqlite3_errmsg (sqlite));
		return 0;
	    }
	  name = gaiaXmlBlobGetName (p_blob, n_bytes);
	  title = gaiaXmlBlobGetTitle (p_blob, n_bytes);
	  abstract = gaiaXmlBlobGetAbstract (p_blob, n_bytes);
	  sqlite3_reset (stmt);
	  sqlite3_clear_bindings (stmt);
	  if (name == NULL)
	      sqlite3_bind_null (stmt, 1);
	  else
	      sqlite3_bind_text (stmt, 1, name, strlen (name), SQLITE_STATIC);
	  if (title == NULL)
	      sqlite3_bind_null (stmt, 2);
	  else
	      sqlite3_bind_text (stmt, 2, title, strlen (title), SQLITE_STATIC);
	  if (abstract == NULL)
	      sqlite3_bind_null (stmt, 3);
	  else
	      sqlite3_bind_text (stmt, 3, abstract, strlen (abstract),
				 SQLITE_STATIC);
	  sqlite3_bind_blob (stmt, 4, p_blob, n_bytes, SQLITE_STATIC);
	  sqlite3_bind_int64 (stmt, 5, id);
	  ret = sqlite3_step (stmt);
	  if (ret == SQLITE_DONE || ret == SQLITE_ROW)
	      ;
	  else
	    {
		spatialite_e ("reloadMapConfiguration() error: \"%s\"\n",
			      sqlite3_errmsg (sqlite));
		sqlite3_finalize (stmt);
		return 0;
	    }
	  sqlite3_finalize (stmt);
	  return 1;
      }
    else
	return 0;
}

SPATIALITE_PRIVATE int
reload_map_configuration (void *p_sqlite, int xid,
			  const char *name,
			  const unsigned char *p_blob, int n_bytes)
{
/* auxiliary function: reloads a Map Configuration definition */
    sqlite3 *sqlite = (sqlite3 *) p_sqlite;
    sqlite3_int64 id;

    if (xid >= 0)
      {
	  /* checking if the MapConfiguration do actually exists */
	  if (check_map_configuration_by_id (sqlite, xid))
	      id = xid;
	  else
	      return 0;
	  /* reloading the Map Configuration */
	  if (map_configuration_causes_duplicate_name
	      (sqlite, id, p_blob, n_bytes))
	      return 0;
	  return do_reload_map_configuration (sqlite, id, p_blob, n_bytes);
      }
    else if (name != NULL)
      {
	  /* checking if the Map Configuration do actually exists */
	  if (!check_map_configuration_by_name (sqlite, name, &id))
	      return 0;
	  /* reloading the Map Configuration */
	  if (map_configuration_causes_duplicate_name
	      (sqlite, id, p_blob, n_bytes))
	      return 0;
	  return do_reload_map_configuration (sqlite, id, p_blob, n_bytes);
      }
    else
	return 0;
}

SPATIALITE_PRIVATE int
register_vector_style (void *p_sqlite, const unsigned char *p_blob, int n_bytes)
{
/* auxiliary function: inserts a Vector Style definition */
    sqlite3 *sqlite = (sqlite3 *) p_sqlite;
    int ret;

Changes to src/spatialite/spatialite.c.

40670
40671
40672
40673
40674
40675
40676


































































































40677
40678
40679
40680
40681
40682
40683
.....
42441
42442
42443
42444
42445
42446
42447

























42448
42449
42450
42451
42452
42453
42454
.....
50863
50864
50865
50866
50867
50868
50869











50870
50871
50872
50873
50874
50875
50876
.....
50929
50930
50931
50932
50933
50934
50935



50936
50937
50938
50939
50940
50941
50942
	  transaction = sqlite3_value_int (argv[1]);
      }
    ret =
	update_vector_coverage_extent (sqlite, cache, coverage_name,
				       transaction);
    sqlite3_result_int (context, ret);
}



































































































static void
fnct_RegisterVectorStyle (sqlite3_context * context, int argc,
			  sqlite3_value ** argv)
{
/* SQL function:
/ RegisterVectorStyle(BLOB style)
................................................................................
	  return;
      }
    p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
    n_bytes = sqlite3_value_bytes (argv[0]);
    ret = gaiaIsSldStyleXmlBlob (p_blob, n_bytes);
    sqlite3_result_int (context, ret);
}


























static void
fnct_XB_IsSvg (sqlite3_context * context, int argc, sqlite3_value ** argv)
{
/* SQL function:
/ XB_IsSvg(XmlBLOB)
/
................................................................................
				fnct_ReloadGroupStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "SE_RegisterStyledGroupStyle", 2,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_RegisterStyledGroupStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "SE_UnRegisterStyledGroupStyle", 2,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_UnRegisterStyledGroupStyle, 0, 0, 0);











    sqlite3_create_function_v2 (db, "CreateIsoMetadataTables", 0,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_CreateIsoMetadataTables, 0, 0, 0);
    sqlite3_create_function_v2 (db, "CreateIsoMetadataTables", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_CreateIsoMetadataTables, 0, 0, 0);
    sqlite3_create_function_v2 (db, "GetIsoMetadataId", 1,
................................................................................
				fnct_XB_IsSldSeVectorStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsSldSeRasterStyle", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSldSeRasterStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsSldStyle", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSldStyle, 0, 0, 0);



    sqlite3_create_function_v2 (db, "XB_IsSvg", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSvg, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsGpx", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsGpx, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_GetSchemaURI", 1,







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>







 







>
>
>







40670
40671
40672
40673
40674
40675
40676
40677
40678
40679
40680
40681
40682
40683
40684
40685
40686
40687
40688
40689
40690
40691
40692
40693
40694
40695
40696
40697
40698
40699
40700
40701
40702
40703
40704
40705
40706
40707
40708
40709
40710
40711
40712
40713
40714
40715
40716
40717
40718
40719
40720
40721
40722
40723
40724
40725
40726
40727
40728
40729
40730
40731
40732
40733
40734
40735
40736
40737
40738
40739
40740
40741
40742
40743
40744
40745
40746
40747
40748
40749
40750
40751
40752
40753
40754
40755
40756
40757
40758
40759
40760
40761
40762
40763
40764
40765
40766
40767
40768
40769
40770
40771
40772
40773
40774
40775
40776
40777
40778
40779
40780
40781
.....
42539
42540
42541
42542
42543
42544
42545
42546
42547
42548
42549
42550
42551
42552
42553
42554
42555
42556
42557
42558
42559
42560
42561
42562
42563
42564
42565
42566
42567
42568
42569
42570
42571
42572
42573
42574
42575
42576
42577
.....
50986
50987
50988
50989
50990
50991
50992
50993
50994
50995
50996
50997
50998
50999
51000
51001
51002
51003
51004
51005
51006
51007
51008
51009
51010
.....
51063
51064
51065
51066
51067
51068
51069
51070
51071
51072
51073
51074
51075
51076
51077
51078
51079
	  transaction = sqlite3_value_int (argv[1]);
      }
    ret =
	update_vector_coverage_extent (sqlite, cache, coverage_name,
				       transaction);
    sqlite3_result_int (context, ret);
}

static void
fnct_RegisterMapConfiguration (sqlite3_context * context, int argc,
			  sqlite3_value ** argv)
{
/* SQL function:
/ RL2_RegisterMapConfiguration(BLOB style)
/
/ inserts an RL2 Map Configuration
/ returns 1 on success
/ 0 on failure, -1 on invalid arguments
*/
    int ret;
    const unsigned char *p_blob;
    int n_bytes;
    sqlite3 *sqlite = sqlite3_context_db_handle (context);
    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
    if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
      {
	  sqlite3_result_int (context, -1);
	  return;
      }
    p_blob = sqlite3_value_blob (argv[0]);
    n_bytes = sqlite3_value_bytes (argv[0]);
    ret = register_map_configuration (sqlite, p_blob, n_bytes);
    sqlite3_result_int (context, ret);
}

static void
fnct_UnRegisterMapConfiguration (sqlite3_context * context, int argc,
			    sqlite3_value ** argv)
{
/* SQL function:
/ UnRegisterMapConfiguration(Integer id )
/   or
/ UnRegisterMapConfiguration(Text name )
/
/ removes a Map Configuration definition
/ returns 1 on success
/ 0 on failure, -1 on invalid arguments
*/
    int ret;
    int id = -1;
    const char *name = NULL;
    sqlite3 *sqlite = sqlite3_context_db_handle (context);
    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
    if (sqlite3_value_type (argv[0]) == SQLITE_INTEGER)
	id = sqlite3_value_int (argv[0]);
    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
	name = (const char *) sqlite3_value_text (argv[0]);
    else
      {
	  sqlite3_result_int (context, -1);
	  return;
      }
    ret = unregister_map_configuration (sqlite, id, name);
    sqlite3_result_int (context, ret);
}

static void
fnct_ReloadMapConfiguration (sqlite3_context * context, int argc,
			sqlite3_value ** argv)
{
/* SQL function:
/ ReloadMapConfiguration(Integer id, BLOB style)
/    or
/ ReloadMapConfiguration(Text name, BLOB style)
/
/ updates a  Map Configuration definition
/ returns 1 on success
/ 0 on failure, -1 on invalid arguments
*/
    int ret;
    int id = -1;
    const char *name = NULL;
    const unsigned char *p_blob;
    int n_bytes;
    sqlite3 *sqlite = sqlite3_context_db_handle (context);
    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
    if (sqlite3_value_type (argv[0]) == SQLITE_INTEGER)
	id = sqlite3_value_int (argv[0]);
    else if (sqlite3_value_type (argv[0]) == SQLITE_TEXT)
	name = (const char *) sqlite3_value_text (argv[0]);
    else
      {
	  sqlite3_result_int (context, -1);
	  return;
      }
    if (sqlite3_value_type (argv[1]) != SQLITE_BLOB)
      {
	  sqlite3_result_int (context, -1);
	  return;
      }
    p_blob = sqlite3_value_blob (argv[1]);
    n_bytes = sqlite3_value_bytes (argv[1]);
    ret = reload_map_configuration (sqlite, id, name, p_blob, n_bytes);
    sqlite3_result_int (context, ret);
}

static void
fnct_RegisterVectorStyle (sqlite3_context * context, int argc,
			  sqlite3_value ** argv)
{
/* SQL function:
/ RegisterVectorStyle(BLOB style)
................................................................................
	  return;
      }
    p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
    n_bytes = sqlite3_value_bytes (argv[0]);
    ret = gaiaIsSldStyleXmlBlob (p_blob, n_bytes);
    sqlite3_result_int (context, ret);
}

static void
fnct_XB_IsMapConfig (sqlite3_context * context, int argc, sqlite3_value ** argv)
{
/* SQL function:
/ XB_IsMapConfig(XmlBLOB)
/
/ returns TRUE if the current BLOB is an XML MapConfig
/ FALSE if it's a valid XmlBLOB but not a MapConfig
/ or -1 if any error is encountered
*/
    unsigned char *p_blob;
    int n_bytes;
    int ret;
    GAIA_UNUSED ();		/* LCOV_EXCL_LINE */
    if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
      {
	  sqlite3_result_int (context, -1);
	  return;
      }
    p_blob = (unsigned char *) sqlite3_value_blob (argv[0]);
    n_bytes = sqlite3_value_bytes (argv[0]);
    ret = gaiaIsMapConfigXmlBlob (p_blob, n_bytes);
    sqlite3_result_int (context, ret);
}

static void
fnct_XB_IsSvg (sqlite3_context * context, int argc, sqlite3_value ** argv)
{
/* SQL function:
/ XB_IsSvg(XmlBLOB)
/
................................................................................
				fnct_ReloadGroupStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "SE_RegisterStyledGroupStyle", 2,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_RegisterStyledGroupStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "SE_UnRegisterStyledGroupStyle", 2,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_UnRegisterStyledGroupStyle, 0, 0, 0);
				
    sqlite3_create_function_v2 (db, "RL2_RegisterMapConfiguration", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_RegisterMapConfiguration, 0, 0, 0);
    sqlite3_create_function_v2 (db, "RL2_UnRegisterMapConfiguration", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_UnRegisterMapConfiguration, 0, 0, 0);
    sqlite3_create_function_v2 (db, "RL2_ReloadMapConfiguration", 2,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_ReloadMapConfiguration, 0, 0, 0);
				
    sqlite3_create_function_v2 (db, "CreateIsoMetadataTables", 0,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_CreateIsoMetadataTables, 0, 0, 0);
    sqlite3_create_function_v2 (db, "CreateIsoMetadataTables", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_CreateIsoMetadataTables, 0, 0, 0);
    sqlite3_create_function_v2 (db, "GetIsoMetadataId", 1,
................................................................................
				fnct_XB_IsSldSeVectorStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsSldSeRasterStyle", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSldSeRasterStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsSldStyle", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSldStyle, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsMapConfig", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsMapConfig, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsSvg", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsSvg, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_IsGpx", 1,
				SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
				fnct_XB_IsGpx, 0, 0, 0);
    sqlite3_create_function_v2 (db, "XB_GetSchemaURI", 1,

Changes to test/Makefile.am.

47
48
49
50
51
52
53

54
55
56
57
58
59
60
...
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
		check_exif \
		check_exif2 \
		check_relations_fncts \
		check_extra_relations_fncts \
		check_geoscvt_fncts \
		check_libxml2 \
		check_styling \

		check_virtualxpath \
		check_virtualbbox \
		check_wfsin \
		check_dxf \
		check_metacatalog \
		check_virtualelem \
		check_srid_fncts \
................................................................................
	symbol.dxf gpkg_test.sqlite gpkg_test.gpkg \
	gpkg_test_broken.gpkg gpkg_test_extrasrid.gpkg \
	elba-pg.shp elba-pg.shx elba-pg.dbf \
	elba-ln.shp elba-ln.shx elba-ln.dbf \
	Gpx-sample.gpx 000323485.gpx \
	sqlproc_sample.txt sqlproc_logfile.txt \
	sqlproc_error.txt orbetello.sqlite \
	test.geojson

SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
	sql_stmt_geos_380 sql_stmt_geos_non380 \
	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
	sql_stmt_mathsql_tests sql_stmt_proj_tests \
	sql_stmt_proj492_tests sql_stmt_proj493_tests \
	sql_stmt_proj600security_tests \







>







 







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
		check_exif \
		check_exif2 \
		check_relations_fncts \
		check_extra_relations_fncts \
		check_geoscvt_fncts \
		check_libxml2 \
		check_styling \
		check_map_config \
		check_virtualxpath \
		check_virtualbbox \
		check_wfsin \
		check_dxf \
		check_metacatalog \
		check_virtualelem \
		check_srid_fncts \
................................................................................
	symbol.dxf gpkg_test.sqlite gpkg_test.gpkg \
	gpkg_test_broken.gpkg gpkg_test_extrasrid.gpkg \
	elba-pg.shp elba-pg.shx elba-pg.dbf \
	elba-ln.shp elba-ln.shx elba-ln.dbf \
	Gpx-sample.gpx 000323485.gpx \
	sqlproc_sample.txt sqlproc_logfile.txt \
	sqlproc_error.txt orbetello.sqlite \
	test.geojson mapconfig.xml mapconfig2.xml

SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
	sql_stmt_geos_380 sql_stmt_geos_non380 \
	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
	sql_stmt_mathsql_tests sql_stmt_proj_tests \
	sql_stmt_proj492_tests sql_stmt_proj493_tests \
	sql_stmt_proj600security_tests \

Changes to test/Makefile.in.

109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
401
402
403
404
405
406
407



408
409
410
411
412
413
414
...
607
608
609
610
611
612
613

614
615
616
617
618
619
620
...
691
692
693
694
695
696
697
698
699
700
701
702

703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
...
736
737
738
739
740
741
742
743
744
745
746
747

748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
....
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
....
1537
1538
1539
1540
1541
1542
1543




1544
1545
1546
1547
1548
1549
1550
....
1795
1796
1797
1798
1799
1800
1801

1802
1803
1804
1805
1806
1807
1808
....
2475
2476
2477
2478
2479
2480
2481







2482
2483
2484
2485
2486
2487
2488
....
3021
3022
3023
3024
3025
3026
3027

3028
3029
3030
3031
3032
3033
3034
....
3170
3171
3172
3173
3174
3175
3176

3177
3178
3179
3180
3181
3182
3183
	check_virtualtable3$(EXEEXT) check_virtualtable4$(EXEEXT) \
	check_virtualtable5$(EXEEXT) check_virtualtable6$(EXEEXT) \
	check_virtual_ovflw$(EXEEXT) check_mbrcache$(EXEEXT) \
	check_spatialindex$(EXEEXT) check_exif$(EXEEXT) \
	check_exif2$(EXEEXT) check_relations_fncts$(EXEEXT) \
	check_extra_relations_fncts$(EXEEXT) \
	check_geoscvt_fncts$(EXEEXT) check_libxml2$(EXEEXT) \
	check_styling$(EXEEXT) check_virtualxpath$(EXEEXT) \

	check_virtualbbox$(EXEEXT) check_wfsin$(EXEEXT) \
	check_dxf$(EXEEXT) check_metacatalog$(EXEEXT) \
	check_virtualelem$(EXEEXT) check_srid_fncts$(EXEEXT) \
	check_control_points$(EXEEXT) check_cutter$(EXEEXT) \
	check_topology2d$(EXEEXT) check_topology3d$(EXEEXT) \
	check_toponoface2d$(EXEEXT) check_topoplus$(EXEEXT) \
	check_toposnap$(EXEEXT) check_network2d$(EXEEXT) \
	check_network3d$(EXEEXT) check_network_log$(EXEEXT) \
	check_virtualknn$(EXEEXT) check_sequence$(EXEEXT) \
	check_stored_proc$(EXEEXT) check_wms$(EXEEXT) \
	check_drop_rename$(EXEEXT) routing_test$(EXEEXT) \
	geojson_test$(EXEEXT) $(am__EXEEXT_1)
@ENABLE_GEOPACKAGE_TRUE@am__append_1 = \
@ENABLE_GEOPACKAGE_TRUE@		check_createBaseTables \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesTable \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesTableMissingSRID \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesZoomLevel \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgInsertEpsgSRID check_gpkgMode \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateFeaturesTable \
................................................................................
check_init2_LDADD = $(LDADD)
check_init_full_SOURCES = check_init_full.c
check_init_full_OBJECTS = check_init_full.$(OBJEXT)
check_init_full_LDADD = $(LDADD)
check_libxml2_SOURCES = check_libxml2.c
check_libxml2_OBJECTS = check_libxml2.$(OBJEXT)
check_libxml2_LDADD = $(LDADD)



check_math_funcs_SOURCES = check_math_funcs.c
check_math_funcs_OBJECTS = check_math_funcs.$(OBJEXT)
check_math_funcs_LDADD = $(LDADD)
check_mbrcache_SOURCES = check_mbrcache.c
check_mbrcache_OBJECTS = check_mbrcache.$(OBJEXT)
check_mbrcache_LDADD = $(LDADD)
check_md5_SOURCES = check_md5.c
................................................................................
	./$(DEPDIR)/check_gpkg_base_core_container_data_file_format_application_id.Po \
	./$(DEPDIR)/check_gpkg_base_core_contents_data_table_def.Po \
	./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po \
	./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po \
	./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po \
	./$(DEPDIR)/check_init.Po ./$(DEPDIR)/check_init2.Po \
	./$(DEPDIR)/check_init_full.Po ./$(DEPDIR)/check_libxml2.Po \

	./$(DEPDIR)/check_math_funcs.Po ./$(DEPDIR)/check_mbrcache.Po \
	./$(DEPDIR)/check_md5.Po ./$(DEPDIR)/check_metacatalog.Po \
	./$(DEPDIR)/check_multithread.Po \
	./$(DEPDIR)/check_network2d.Po ./$(DEPDIR)/check_network3d.Po \
	./$(DEPDIR)/check_network_log.Po \
	./$(DEPDIR)/check_recover_geom.Po \
	./$(DEPDIR)/check_relations_fncts.Po \
................................................................................
	check_gpkgMode.c check_gpkgVirtual.c \
	check_gpkg_base_core_container_data_file_format_application_id.c \
	check_gpkg_base_core_contents_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_values_default.c \
	check_gpkg_opt_extension_mechanism_extensions_data_table_def.c \
	check_init.c check_init2.c check_init_full.c check_libxml2.c \
	check_math_funcs.c check_mbrcache.c check_md5.c \
	check_metacatalog.c check_multithread.c check_network2d.c \
	check_network3d.c check_network_log.c check_recover_geom.c \
	check_relations_fncts.c check_sequence.c check_shp_load.c \
	check_shp_load_3d.c check_spatialindex.c check_sql_stmt.c \

	check_sql_stmt_extension.c check_sql_stmt_legacy.c \
	check_sql_stmt_tiny.c check_srid_fncts.c check_stored_proc.c \
	check_styling.c check_topology2d.c check_topology3d.c \
	check_toponoface2d.c check_topoplus.c check_toposnap.c \
	check_version.c check_virtual_ovflw.c check_virtualbbox.c \
	check_virtualelem.c check_virtualknn.c check_virtualtable1.c \
	check_virtualtable2.c check_virtualtable3.c \
	check_virtualtable4.c check_virtualtable5.c \
	check_virtualtable6.c check_virtualxpath.c check_wfsin.c \
	check_wms.c check_xls_load.c geojson_test.c routing_test.c \
	shape_3d.c shape_cp1252.c shape_primitives.c shape_utf8_1.c \
	shape_utf8_1ex.c shape_utf8_2.c
DIST_SOURCES = check_add_tile_triggers.c \
	check_add_tile_triggers_bad_table_name.c check_bufovflw.c \
	check_clone_table.c check_control_points.c check_create.c \
	check_createBaseTables.c check_cutter.c check_dbf_load.c \
	check_drop_rename.c check_dxf.c check_endian.c check_exif.c \
	check_exif2.c check_extension.c check_extra_relations_fncts.c \
................................................................................
	check_gpkgMode.c check_gpkgVirtual.c \
	check_gpkg_base_core_container_data_file_format_application_id.c \
	check_gpkg_base_core_contents_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_values_default.c \
	check_gpkg_opt_extension_mechanism_extensions_data_table_def.c \
	check_init.c check_init2.c check_init_full.c check_libxml2.c \
	check_math_funcs.c check_mbrcache.c check_md5.c \
	check_metacatalog.c check_multithread.c check_network2d.c \
	check_network3d.c check_network_log.c check_recover_geom.c \
	check_relations_fncts.c check_sequence.c check_shp_load.c \
	check_shp_load_3d.c check_spatialindex.c check_sql_stmt.c \

	check_sql_stmt_extension.c check_sql_stmt_legacy.c \
	check_sql_stmt_tiny.c check_srid_fncts.c check_stored_proc.c \
	check_styling.c check_topology2d.c check_topology3d.c \
	check_toponoface2d.c check_topoplus.c check_toposnap.c \
	check_version.c check_virtual_ovflw.c check_virtualbbox.c \
	check_virtualelem.c check_virtualknn.c check_virtualtable1.c \
	check_virtualtable2.c check_virtualtable3.c \
	check_virtualtable4.c check_virtualtable5.c \
	check_virtualtable6.c check_virtualxpath.c check_wfsin.c \
	check_wms.c check_xls_load.c geojson_test.c routing_test.c \
	shape_3d.c shape_cp1252.c shape_primitives.c shape_utf8_1.c \
	shape_utf8_1ex.c shape_utf8_2.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
	install-ps-recursive install-recursive installcheck-recursive \
................................................................................
	symbol.dxf gpkg_test.sqlite gpkg_test.gpkg \
	gpkg_test_broken.gpkg gpkg_test_extrasrid.gpkg \
	elba-pg.shp elba-pg.shx elba-pg.dbf \
	elba-ln.shp elba-ln.shx elba-ln.dbf \
	Gpx-sample.gpx 000323485.gpx \
	sqlproc_sample.txt sqlproc_logfile.txt \
	sqlproc_error.txt orbetello.sqlite \
	test.geojson

SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
	sql_stmt_geos_380 sql_stmt_geos_non380 \
	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
	sql_stmt_mathsql_tests sql_stmt_proj_tests \
	sql_stmt_proj492_tests sql_stmt_proj493_tests \
	sql_stmt_proj600security_tests \
................................................................................
check_init_full$(EXEEXT): $(check_init_full_OBJECTS) $(check_init_full_DEPENDENCIES) $(EXTRA_check_init_full_DEPENDENCIES) 
	@rm -f check_init_full$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_init_full_OBJECTS) $(check_init_full_LDADD) $(LIBS)

check_libxml2$(EXEEXT): $(check_libxml2_OBJECTS) $(check_libxml2_DEPENDENCIES) $(EXTRA_check_libxml2_DEPENDENCIES) 
	@rm -f check_libxml2$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_libxml2_OBJECTS) $(check_libxml2_LDADD) $(LIBS)





check_math_funcs$(EXEEXT): $(check_math_funcs_OBJECTS) $(check_math_funcs_DEPENDENCIES) $(EXTRA_check_math_funcs_DEPENDENCIES) 
	@rm -f check_math_funcs$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_math_funcs_OBJECTS) $(check_math_funcs_LDADD) $(LIBS)

check_mbrcache$(EXEEXT): $(check_mbrcache_OBJECTS) $(check_mbrcache_DEPENDENCIES) $(EXTRA_check_mbrcache_DEPENDENCIES) 
	@rm -f check_mbrcache$(EXEEXT)
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init_full.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_libxml2.Po@am__quote@ # am--include-marker

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_math_funcs.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mbrcache.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_md5.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_metacatalog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_multithread.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_network2d.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_network3d.Po@am__quote@ # am--include-marker
................................................................................
check_styling.log: check_styling$(EXEEXT)
	@p='check_styling$(EXEEXT)'; \
	b='check_styling'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)







check_virtualxpath.log: check_virtualxpath$(EXEEXT)
	@p='check_virtualxpath$(EXEEXT)'; \
	b='check_virtualxpath'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
................................................................................
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po
	-rm -f ./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_init.Po
	-rm -f ./$(DEPDIR)/check_init2.Po
	-rm -f ./$(DEPDIR)/check_init_full.Po
	-rm -f ./$(DEPDIR)/check_libxml2.Po

	-rm -f ./$(DEPDIR)/check_math_funcs.Po
	-rm -f ./$(DEPDIR)/check_mbrcache.Po
	-rm -f ./$(DEPDIR)/check_md5.Po
	-rm -f ./$(DEPDIR)/check_metacatalog.Po
	-rm -f ./$(DEPDIR)/check_multithread.Po
	-rm -f ./$(DEPDIR)/check_network2d.Po
	-rm -f ./$(DEPDIR)/check_network3d.Po
................................................................................
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po
	-rm -f ./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_init.Po
	-rm -f ./$(DEPDIR)/check_init2.Po
	-rm -f ./$(DEPDIR)/check_init_full.Po
	-rm -f ./$(DEPDIR)/check_libxml2.Po

	-rm -f ./$(DEPDIR)/check_math_funcs.Po
	-rm -f ./$(DEPDIR)/check_mbrcache.Po
	-rm -f ./$(DEPDIR)/check_md5.Po
	-rm -f ./$(DEPDIR)/check_metacatalog.Po
	-rm -f ./$(DEPDIR)/check_multithread.Po
	-rm -f ./$(DEPDIR)/check_network2d.Po
	-rm -f ./$(DEPDIR)/check_network3d.Po







|
>
|
|
|
|
|
|
|
|
|
<
|
|







 







>
>
>







 







>







 







|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|







 







|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|







 







|







 







>
>
>
>







 







>







 







>
>
>
>
>
>
>







 







>







 







>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
...
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
...
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
...
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
...
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
....
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
....
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
....
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
....
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
....
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
....
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
	check_virtualtable3$(EXEEXT) check_virtualtable4$(EXEEXT) \
	check_virtualtable5$(EXEEXT) check_virtualtable6$(EXEEXT) \
	check_virtual_ovflw$(EXEEXT) check_mbrcache$(EXEEXT) \
	check_spatialindex$(EXEEXT) check_exif$(EXEEXT) \
	check_exif2$(EXEEXT) check_relations_fncts$(EXEEXT) \
	check_extra_relations_fncts$(EXEEXT) \
	check_geoscvt_fncts$(EXEEXT) check_libxml2$(EXEEXT) \
	check_styling$(EXEEXT) check_map_config$(EXEEXT) \
	check_virtualxpath$(EXEEXT) check_virtualbbox$(EXEEXT) \
	check_wfsin$(EXEEXT) check_dxf$(EXEEXT) \
	check_metacatalog$(EXEEXT) check_virtualelem$(EXEEXT) \
	check_srid_fncts$(EXEEXT) check_control_points$(EXEEXT) \
	check_cutter$(EXEEXT) check_topology2d$(EXEEXT) \
	check_topology3d$(EXEEXT) check_toponoface2d$(EXEEXT) \
	check_topoplus$(EXEEXT) check_toposnap$(EXEEXT) \
	check_network2d$(EXEEXT) check_network3d$(EXEEXT) \
	check_network_log$(EXEEXT) check_virtualknn$(EXEEXT) \
	check_sequence$(EXEEXT) check_stored_proc$(EXEEXT) \

	check_wms$(EXEEXT) check_drop_rename$(EXEEXT) \
	routing_test$(EXEEXT) geojson_test$(EXEEXT) $(am__EXEEXT_1)
@ENABLE_GEOPACKAGE_TRUE@am__append_1 = \
@ENABLE_GEOPACKAGE_TRUE@		check_createBaseTables \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesTable \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesTableMissingSRID \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateTilesZoomLevel \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgInsertEpsgSRID check_gpkgMode \
@ENABLE_GEOPACKAGE_TRUE@		check_gpkgCreateFeaturesTable \
................................................................................
check_init2_LDADD = $(LDADD)
check_init_full_SOURCES = check_init_full.c
check_init_full_OBJECTS = check_init_full.$(OBJEXT)
check_init_full_LDADD = $(LDADD)
check_libxml2_SOURCES = check_libxml2.c
check_libxml2_OBJECTS = check_libxml2.$(OBJEXT)
check_libxml2_LDADD = $(LDADD)
check_map_config_SOURCES = check_map_config.c
check_map_config_OBJECTS = check_map_config.$(OBJEXT)
check_map_config_LDADD = $(LDADD)
check_math_funcs_SOURCES = check_math_funcs.c
check_math_funcs_OBJECTS = check_math_funcs.$(OBJEXT)
check_math_funcs_LDADD = $(LDADD)
check_mbrcache_SOURCES = check_mbrcache.c
check_mbrcache_OBJECTS = check_mbrcache.$(OBJEXT)
check_mbrcache_LDADD = $(LDADD)
check_md5_SOURCES = check_md5.c
................................................................................
	./$(DEPDIR)/check_gpkg_base_core_container_data_file_format_application_id.Po \
	./$(DEPDIR)/check_gpkg_base_core_contents_data_table_def.Po \
	./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po \
	./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po \
	./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po \
	./$(DEPDIR)/check_init.Po ./$(DEPDIR)/check_init2.Po \
	./$(DEPDIR)/check_init_full.Po ./$(DEPDIR)/check_libxml2.Po \
	./$(DEPDIR)/check_map_config.Po \
	./$(DEPDIR)/check_math_funcs.Po ./$(DEPDIR)/check_mbrcache.Po \
	./$(DEPDIR)/check_md5.Po ./$(DEPDIR)/check_metacatalog.Po \
	./$(DEPDIR)/check_multithread.Po \
	./$(DEPDIR)/check_network2d.Po ./$(DEPDIR)/check_network3d.Po \
	./$(DEPDIR)/check_network_log.Po \
	./$(DEPDIR)/check_recover_geom.Po \
	./$(DEPDIR)/check_relations_fncts.Po \
................................................................................
	check_gpkgMode.c check_gpkgVirtual.c \
	check_gpkg_base_core_container_data_file_format_application_id.c \
	check_gpkg_base_core_contents_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_values_default.c \
	check_gpkg_opt_extension_mechanism_extensions_data_table_def.c \
	check_init.c check_init2.c check_init_full.c check_libxml2.c \
	check_map_config.c check_math_funcs.c check_mbrcache.c \
	check_md5.c check_metacatalog.c check_multithread.c \
	check_network2d.c check_network3d.c check_network_log.c \
	check_recover_geom.c check_relations_fncts.c check_sequence.c \
	check_shp_load.c check_shp_load_3d.c check_spatialindex.c \
	check_sql_stmt.c check_sql_stmt_extension.c \
	check_sql_stmt_legacy.c check_sql_stmt_tiny.c \
	check_srid_fncts.c check_stored_proc.c check_styling.c \
	check_topology2d.c check_topology3d.c check_toponoface2d.c \
	check_topoplus.c check_toposnap.c check_version.c \
	check_virtual_ovflw.c check_virtualbbox.c check_virtualelem.c \
	check_virtualknn.c check_virtualtable1.c check_virtualtable2.c \
	check_virtualtable3.c check_virtualtable4.c \
	check_virtualtable5.c check_virtualtable6.c \
	check_virtualxpath.c check_wfsin.c check_wms.c \
	check_xls_load.c geojson_test.c routing_test.c shape_3d.c \
	shape_cp1252.c shape_primitives.c shape_utf8_1.c \
	shape_utf8_1ex.c shape_utf8_2.c
DIST_SOURCES = check_add_tile_triggers.c \
	check_add_tile_triggers_bad_table_name.c check_bufovflw.c \
	check_clone_table.c check_control_points.c check_create.c \
	check_createBaseTables.c check_cutter.c check_dbf_load.c \
	check_drop_rename.c check_dxf.c check_endian.c check_exif.c \
	check_exif2.c check_extension.c check_extra_relations_fncts.c \
................................................................................
	check_gpkgMode.c check_gpkgVirtual.c \
	check_gpkg_base_core_container_data_file_format_application_id.c \
	check_gpkg_base_core_contents_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_table_def.c \
	check_gpkg_base_core_spatial_ref_sys_data_values_default.c \
	check_gpkg_opt_extension_mechanism_extensions_data_table_def.c \
	check_init.c check_init2.c check_init_full.c check_libxml2.c \
	check_map_config.c check_math_funcs.c check_mbrcache.c \
	check_md5.c check_metacatalog.c check_multithread.c \
	check_network2d.c check_network3d.c check_network_log.c \
	check_recover_geom.c check_relations_fncts.c check_sequence.c \
	check_shp_load.c check_shp_load_3d.c check_spatialindex.c \
	check_sql_stmt.c check_sql_stmt_extension.c \
	check_sql_stmt_legacy.c check_sql_stmt_tiny.c \
	check_srid_fncts.c check_stored_proc.c check_styling.c \
	check_topology2d.c check_topology3d.c check_toponoface2d.c \
	check_topoplus.c check_toposnap.c check_version.c \
	check_virtual_ovflw.c check_virtualbbox.c check_virtualelem.c \
	check_virtualknn.c check_virtualtable1.c check_virtualtable2.c \
	check_virtualtable3.c check_virtualtable4.c \
	check_virtualtable5.c check_virtualtable6.c \
	check_virtualxpath.c check_wfsin.c check_wms.c \
	check_xls_load.c geojson_test.c routing_test.c shape_3d.c \
	shape_cp1252.c shape_primitives.c shape_utf8_1.c \
	shape_utf8_1ex.c shape_utf8_2.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
	install-ps-recursive install-recursive installcheck-recursive \
................................................................................
	symbol.dxf gpkg_test.sqlite gpkg_test.gpkg \
	gpkg_test_broken.gpkg gpkg_test_extrasrid.gpkg \
	elba-pg.shp elba-pg.shx elba-pg.dbf \
	elba-ln.shp elba-ln.shx elba-ln.dbf \
	Gpx-sample.gpx 000323485.gpx \
	sqlproc_sample.txt sqlproc_logfile.txt \
	sqlproc_error.txt orbetello.sqlite \
	test.geojson mapconfig.xml mapconfig2.xml

SUBDIRS = sql_stmt_geosadvanced_tests sql_stmt_geos_tests \
	sql_stmt_geos_380 sql_stmt_geos_non380 \
	sql_stmt_libxml2_tests sql_stmt_rtgeom_tests \
	sql_stmt_mathsql_tests sql_stmt_proj_tests \
	sql_stmt_proj492_tests sql_stmt_proj493_tests \
	sql_stmt_proj600security_tests \
................................................................................
check_init_full$(EXEEXT): $(check_init_full_OBJECTS) $(check_init_full_DEPENDENCIES) $(EXTRA_check_init_full_DEPENDENCIES) 
	@rm -f check_init_full$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_init_full_OBJECTS) $(check_init_full_LDADD) $(LIBS)

check_libxml2$(EXEEXT): $(check_libxml2_OBJECTS) $(check_libxml2_DEPENDENCIES) $(EXTRA_check_libxml2_DEPENDENCIES) 
	@rm -f check_libxml2$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_libxml2_OBJECTS) $(check_libxml2_LDADD) $(LIBS)

check_map_config$(EXEEXT): $(check_map_config_OBJECTS) $(check_map_config_DEPENDENCIES) $(EXTRA_check_map_config_DEPENDENCIES) 
	@rm -f check_map_config$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_map_config_OBJECTS) $(check_map_config_LDADD) $(LIBS)

check_math_funcs$(EXEEXT): $(check_math_funcs_OBJECTS) $(check_math_funcs_DEPENDENCIES) $(EXTRA_check_math_funcs_DEPENDENCIES) 
	@rm -f check_math_funcs$(EXEEXT)
	$(AM_V_CCLD)$(LINK) $(check_math_funcs_OBJECTS) $(check_math_funcs_LDADD) $(LIBS)

check_mbrcache$(EXEEXT): $(check_mbrcache_OBJECTS) $(check_mbrcache_DEPENDENCIES) $(EXTRA_check_mbrcache_DEPENDENCIES) 
	@rm -f check_mbrcache$(EXEEXT)
................................................................................
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_init_full.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_libxml2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_map_config.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_math_funcs.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mbrcache.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_md5.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_metacatalog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_multithread.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_network2d.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_network3d.Po@am__quote@ # am--include-marker
................................................................................
check_styling.log: check_styling$(EXEEXT)
	@p='check_styling$(EXEEXT)'; \
	b='check_styling'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
check_map_config.log: check_map_config$(EXEEXT)
	@p='check_map_config$(EXEEXT)'; \
	b='check_map_config'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
check_virtualxpath.log: check_virtualxpath$(EXEEXT)
	@p='check_virtualxpath$(EXEEXT)'; \
	b='check_virtualxpath'; \
	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
	--log-file $$b.log --trs-file $$b.trs \
	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
	"$$tst" $(AM_TESTS_FD_REDIRECT)
................................................................................
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po
	-rm -f ./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_init.Po
	-rm -f ./$(DEPDIR)/check_init2.Po
	-rm -f ./$(DEPDIR)/check_init_full.Po
	-rm -f ./$(DEPDIR)/check_libxml2.Po
	-rm -f ./$(DEPDIR)/check_map_config.Po
	-rm -f ./$(DEPDIR)/check_math_funcs.Po
	-rm -f ./$(DEPDIR)/check_mbrcache.Po
	-rm -f ./$(DEPDIR)/check_md5.Po
	-rm -f ./$(DEPDIR)/check_metacatalog.Po
	-rm -f ./$(DEPDIR)/check_multithread.Po
	-rm -f ./$(DEPDIR)/check_network2d.Po
	-rm -f ./$(DEPDIR)/check_network3d.Po
................................................................................
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_gpkg_base_core_spatial_ref_sys_data_values_default.Po
	-rm -f ./$(DEPDIR)/check_gpkg_opt_extension_mechanism_extensions_data_table_def.Po
	-rm -f ./$(DEPDIR)/check_init.Po
	-rm -f ./$(DEPDIR)/check_init2.Po
	-rm -f ./$(DEPDIR)/check_init_full.Po
	-rm -f ./$(DEPDIR)/check_libxml2.Po
	-rm -f ./$(DEPDIR)/check_map_config.Po
	-rm -f ./$(DEPDIR)/check_math_funcs.Po
	-rm -f ./$(DEPDIR)/check_mbrcache.Po
	-rm -f ./$(DEPDIR)/check_md5.Po
	-rm -f ./$(DEPDIR)/check_metacatalog.Po
	-rm -f ./$(DEPDIR)/check_multithread.Po
	-rm -f ./$(DEPDIR)/check_network2d.Po
	-rm -f ./$(DEPDIR)/check_network3d.Po

Added test/check_map_config.c.





























































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398

/*

 check_map_config.c -- SpatiaLite Test Case

 Author: Sandro Furieri <a.furieri@lqt.it>

 ------------------------------------------------------------------------------
 
 Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/
 
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.

The Original Code is the SpatiaLite library

The Initial Developer of the Original Code is Alessandro Furieri
 
Portions created by the Initial Developer are Copyright (C) 2020
the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
 
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "config.h"

#include "sqlite3.h"
#include "spatialite.h"

int
execute_check (sqlite3 * sqlite, const char *sql, char **error)
{
/* executing an SQL statement returning True/False */
    sqlite3_stmt *stmt;
    int ret;
    int retcode = 0;

    if (error != NULL)
	*error = NULL;
    ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
    if (ret != SQLITE_OK)
      {
	  if (error != NULL)
	      *error = sqlite3_mprintf ("%s", sqlite3_errmsg (sqlite));
	  return SQLITE_ERROR;
      }
    ret = sqlite3_step (stmt);
    if (ret == SQLITE_DONE || ret == SQLITE_ROW)
      {
	  if (sqlite3_column_int (stmt, 0) == 1)
	      retcode = 1;
      }
    sqlite3_finalize (stmt);
    if (retcode == 1)
	return SQLITE_OK;
    return SQLITE_ERROR;
}

#ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
#ifndef OMIT_ICONV		/* only if ICONV is supported */

static unsigned char *
load_blob (const char *path, int *blob_len)
{
/* loading an external image */
    unsigned char *blob;
    int sz = 0;
    int rd;
    FILE *fl = fopen (path, "rb");
    if (!fl)
      {
	  fprintf (stderr, "cannot open \"%s\"\n", path);
	  return NULL;
      }
    if (fseek (fl, 0, SEEK_END) == 0)
	sz = ftell (fl);
    blob = (unsigned char *) malloc (sz);
    *blob_len = sz;
    rewind (fl);
    rd = fread (blob, 1, sz, fl);
    if (rd != sz)
      {
	  fprintf (stderr, "read error \"%s\"\n", path);
	  return NULL;
      }
    fclose (fl);
    return blob;
}

static unsigned char *
load_xml (const char *path, int *len)
{
/* loading an external XML */
    unsigned char *xml;
    int sz = 0;
    int rd;
    FILE *fl = fopen (path, "rb");
    if (!fl)
      {
	  fprintf (stderr, "cannot open \"%s\"\n", path);
	  return NULL;
      }
    if (fseek (fl, 0, SEEK_END) == 0)
	sz = ftell (fl);
    xml = malloc (sz + 1);
    *len = sz;
    rewind (fl);
    rd = fread (xml, 1, sz, fl);
    if (rd != sz)
      {
	  fprintf (stderr, "read error \"%s\"\n", path);
	  return NULL;
      }
    fclose (fl);
    xml[rd] = '\0';
    return xml;
}

static char *
build_hex_blob (const unsigned char *blob, int blob_len)
{
/* building an HEX blob */
    int i;
    const unsigned char *p_in = blob;
    char *hex = malloc ((blob_len * 2) + 1);
    char *p_out = hex;
    for (i = 0; i < blob_len; i++)
      {
	  sprintf (p_out, "%02x", *p_in);
	  p_in++;
	  p_out += 2;
      }
    return hex;
}

static int
check_map_config (sqlite3 * handle, void *cache)
{
/* testing RL2 Map Configuration */
    int ret;
    char *err_msg = NULL;
    char *sql;
    unsigned char *blob;
    int blob_len;
    char *hexBlob;
    unsigned char *xml;
    int len;

/* testing Map Configuration */
    xml = load_xml ("mapconfig.xml", &len);
    if (xml == NULL)
	return -4;
    gaiaXmlToBlob (cache, xml, len, 1, NULL, &blob, &blob_len, NULL, NULL);
    free (xml);
    if (blob == NULL)
      {
	  fprintf (stderr, "this is not a well-formed XML !!!\n");
	  return -5;
      }
    hexBlob = build_hex_blob (blob, blob_len);
    free (blob);
    if (hexBlob == NULL)
	return -6;

/* Register Map Configuration Layer */
    sql = sqlite3_mprintf ("SELECT RL2_RegisterMapConfiguration(x%Q)", hexBlob);
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error RegisterMapConfiguration #1: %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -7;
      }

    xml = load_xml ("mapconfig2.xml", &len);
    if (xml == NULL)
	return -10;
    gaiaXmlToBlob (cache, xml, len, 1, NULL, &blob, &blob_len, NULL, NULL);
    free (xml);
    if (blob == NULL)
      {
	  fprintf (stderr, "this is not a well-formed XML !!!\n");
	  return -11;
      }
    hexBlob = build_hex_blob (blob, blob_len);
    free (blob);
    if (hexBlob == NULL)
	return -12;

    sql = sqlite3_mprintf ("SELECT RL2_RegisterMapConfiguration(x%Q)", hexBlob);
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error RegisterMapConfiguration #2: %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -13;
      }

/* Reload Map Configuration */
    sql = sqlite3_mprintf ("SELECT RL2_ReloadMapConfiguration(12, x%Q)", hexBlob);
    ret = execute_check (handle, sql, NULL);
    sqlite3_free (sql);
    if (ret == SQLITE_OK)
      {
	  fprintf (stderr, "Error MapConfiguration #1: %s\n\n",
		   "expected failure");
	  return -17;
      }

    sql = sqlite3_mprintf ("SELECT RL2_ReloadMapConfiguration(1, x%Q)", hexBlob);
    ret = execute_check (handle, sql, NULL);
    sqlite3_free (sql);
    if (ret == SQLITE_OK)
      {
	  fprintf (stderr, "Error MapConfiguration #2: %s\n\n",
		   "expected failure");
	  return -18;
      }

    sql =
	sqlite3_mprintf ("SELECT RL2_ReloadMapConfiguration('bad map', x%Q)",
			 hexBlob);
    ret = execute_check (handle, sql, NULL);
    sqlite3_free (sql);
    if (ret == SQLITE_OK)
      {
	  fprintf (stderr, "Error MapConfiguration #4: %s\n\n",
		   "expected failure");
	  return -20;
      }
    free (hexBlob);

    xml = load_xml ("mapconfig.xml", &len);
    if (xml == NULL)
	return -22;
    gaiaXmlToBlob (cache, xml, len, 1, NULL, &blob, &blob_len, NULL, NULL);
    free (xml);
    if (blob == NULL)
      {
	  fprintf (stderr, "this is not a well-formed XML !!!\n");
	  return -23;
      }
    hexBlob = build_hex_blob (blob, blob_len);
    free (blob);
    if (hexBlob == NULL)
	return -24;
    sql = sqlite3_mprintf ("SELECT RL2_ReloadMapConfiguration(1, x%Q)", hexBlob);
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error ReloadMapConfiguration #6: %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -25;
      }
      
    sql = sqlite3_mprintf ("SELECT RL2_ReloadMapConfiguration('my-map', x%Q)", hexBlob);
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error ReloadMapConfiguration #7: %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -26;
      }
    free (hexBlob);

/* Unregister Map Configuration */
    sql = sqlite3_mprintf ("SELECT RL2_UnRegisterMapConfiguration(5)");
    ret = execute_check (handle, sql, NULL);
    sqlite3_free (sql);
    if (ret == SQLITE_OK)
      {
	  fprintf (stderr, "Error UnRegisterMapConfiguration #1: %s\n\n",
		   "expected failure");
	  return -27;
      }

    sql = sqlite3_mprintf ("SELECT RL2_UnRegisterMapConfiguration('alpha')");
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret == SQLITE_OK)
      {
	  fprintf (stderr, "Error UnRegisterMapConfiguration #2: %s\n\n",
		   "expected failure");
	  return -28;
      }

    sql = sqlite3_mprintf ("SELECT RL2_UnRegisterMapConfiguration('another-map')");
    ret = execute_check (handle, sql, &err_msg);
    sqlite3_free (sql);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error UnRegisterMapConfiguration #4: %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -31;
      }

    return 0;
}

#endif
#endif

int
main (int argc, char *argv[])
{
    int ret;
    sqlite3 *handle;
    char *err_msg = NULL;
    char *sql;
    void *cache = spatialite_alloc_connection ();

    if (argc > 1 || argv[0] == NULL)
	argc = 1;		/* silencing stupid compiler warnings */

    ret =
	sqlite3_open_v2 (":memory:", &handle,
			 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "cannot open in-memory db: %s\n",
		   sqlite3_errmsg (handle));
	  sqlite3_close (handle);
	  return -1;
      }

    spatialite_init_ex (handle, cache, 0);

    sql = "SELECT InitSpatialMetadata(1, 'WGS84')";
    ret = execute_check (handle, sql, &err_msg);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr,
		   "Unexpected InitSpatialMetadata result: %i, (%s)\n", ret,
		   err_msg);
	  sqlite3_free (err_msg);
	  return -2;
      }

#ifdef ENABLE_LIBXML2		/* only if LIBXML2 is supported */
#ifndef OMIT_ICONV		/* only if ICONV is supported */

/* creating the Styling Tables */
    sql = "SELECT CreateStylingTables(1)";
    ret = execute_check (handle, sql, &err_msg);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "Error CreateStylingTables %s\n\n", err_msg);
	  sqlite3_free (err_msg);
	  return -3;
      }

    ret = check_map_config (handle, cache);
    if (ret != 0)
	return -100 - ret;

#endif
#endif

    ret = sqlite3_close (handle);
    if (ret != SQLITE_OK)
      {
	  fprintf (stderr, "sqlite3_close() error: %s\n",
		   sqlite3_errmsg (handle));
	  return -57;
      }

    spatialite_cleanup_ex (cache);

    spatialite_shutdown ();
    return 0;
}

Added test/mapconfig.xml.

































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="UTF-8"?>
<RL2MapConfig version="1.0" xmlns="http://www.gaia-gis.it/RL2MapConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gaia-gis.it/RL2MapConfig http://www.gaia-gis.it/RL2MapConfig_1_0.xsd" >
	<Name>my-map</Name>
	<Description>
		<Title>another arbitraty title</Title>
		<Abstract>another abstract as another</Abstract>
	</Description>
	<MapOptions>
		<MultiThreading Enabled="true" MaxThreads="8" />
		<MapCrs Crs="EPSG:3003" AutoTransformEnabled="true" />
		<GeographicCoords DMS="false" />
		<MapBackground Color="#ffffff" Transparent="true" />
	</MapOptions>
	<MapAttachedDatabases>
		<MapAttachedDB DbPrefix="a" Path="/home/sandro/valdisieve.sqlite" />
	</MapAttachedDatabases>
	<MapLayer Type="wms" DbPrefix="a" Name="rt_topogr.topografica50k.rt" Visible="true">
		<WmsLayerStyle>
			<GetMap URL="http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmstopogr&amp;map_resolution=91&amp;language=ita&amp;" />
			<WmsProtocol Version="1.3.0" />
			<ReferenceSystem Crs="EPSG:3003" />
			<ImageFormat MimeType="image/png" Opaque="false" />
		</WmsLayerStyle>
	</MapLayer>
	<MapLayer Type="vector" DbPrefix="a" Name="comuni" Visible="true">
		<VectorLayerStyle>
			<PolygonSymbolizer>
				<Fill>
					<SvgParameter name="fill">#1e90ff</SvgParameter>
					<SvgParameter name="fill-opacity">0.20</SvgParameter>
				</Fill>
				<Stroke>
					<SvgParameter name="stroke">#7cc254</SvgParameter>
					<SvgParameter name="stroke-opacity">1.00</SvgParameter>
					<SvgParameter name="stroke-width">1.00</SvgParameter>
					<SvgParameter name="stroke-linejoin">round</SvgParameter>
					<SvgParameter name="stroke-linecap">round</SvgParameter>
				</Stroke>
			</PolygonSymbolizer>
		</VectorLayerStyle>
	</MapLayer>
	<MapLayer Type="vector" DbPrefix="a" Name="localita" Visible="true">
		<VectorLayerStyle>
			<PolygonSymbolizer>
				<Fill>
					<SvgParameter name="fill">#ffa500</SvgParameter>
					<SvgParameter name="fill-opacity">1.00</SvgParameter>
				</Fill>
				<Stroke>
					<SvgParameter name="stroke">#9475d8</SvgParameter>
					<SvgParameter name="stroke-opacity">1.00</SvgParameter>
					<SvgParameter name="stroke-width">1.00</SvgParameter>
					<SvgParameter name="stroke-linejoin">round</SvgParameter>
					<SvgParameter name="stroke-linecap">round</SvgParameter>
				</Stroke>
			</PolygonSymbolizer>
		</VectorLayerStyle>
	</MapLayer>
	<MapLayer Type="vector" DbPrefix="a" Name="paline" Visible="true">
		<VectorLayerStyle>
			<PointSymbolizer>
				<Graphic>
					<Mark>
						<WellKnownName>circle</WellKnownName>
						<Fill>
							<SvgParameter name="fill">#ff0000</SvgParameter>
						</Fill>
						<Stroke>
							<SvgParameter name="stroke">#5cbba8</SvgParameter>
							<SvgParameter name="stroke-width">1.00</SvgParameter>
							<SvgParameter name="stroke-linejoin">round</SvgParameter>
							<SvgParameter name="stroke-linecap">round</SvgParameter>
						</Stroke>
					</Mark>
					<Size>6.00</Size>
				</Graphic>
			</PointSymbolizer>
		</VectorLayerStyle>
	</MapLayer>
</RL2MapConfig>

Added test/mapconfig2.xml.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<RL2MapConfig version="1.0" xmlns="http://www.gaia-gis.it/RL2MapConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gaia-gis.it/RL2MapConfig http://www.gaia-gis.it/RL2MapConfig_1_0.xsd" >
	<Name>another-map</Name>
	<Description>
		<Title>this is an arbitraty title</Title>
		<Abstract>yet another abstract</Abstract>
	</Description>
	<MapOptions>
		<MultiThreading Enabled="true" MaxThreads="8" />
		<MapCrs Crs="EPSG:3003" AutoTransformEnabled="true" />
		<GeographicCoords DMS="false" />
		<MapBackground Color="#ffffff" Transparent="true" />
	</MapOptions>
	<MapAttachedDatabases>
		<MapAttachedDB DbPrefix="a" Path="/home/sandro/valdisieve.sqlite" />
	</MapAttachedDatabases>
	<MapLayer Type="wms" DbPrefix="a" Name="rt_topogr.topografica50k.rt" Visible="true">
		<WmsLayerStyle>
			<GetMap URL="http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmstopogr&amp;map_resolution=91&amp;language=ita&amp;" />
			<WmsProtocol Version="1.3.0" />
			<ReferenceSystem Crs="EPSG:3003" />
			<ImageFormat MimeType="image/png" Opaque="false" />
		</WmsLayerStyle>
	</MapLayer>
	<MapLayer Type="vector" DbPrefix="a" Name="comuni" Visible="true">
		<VectorLayerStyle>
			<PolygonSymbolizer>
				<Fill>
					<SvgParameter name="fill">#1e90ff</SvgParameter>
					<SvgParameter name="fill-opacity">0.20</SvgParameter>
				</Fill>
				<Stroke>
					<SvgParameter name="stroke">#7cc254</SvgParameter>
					<SvgParameter name="stroke-opacity">1.00</SvgParameter>
					<SvgParameter name="stroke-width">1.00</SvgParameter>
					<SvgParameter name="stroke-linejoin">round</SvgParameter>
					<SvgParameter name="stroke-linecap">round</SvgParameter>
				</Stroke>
			</PolygonSymbolizer>
		</VectorLayerStyle>
	</MapLayer>
</RL2MapConfig>

Changes to test/sql_stmt_libxml2_tests/Makefile.am.

45
46
47
48
49
50
51







52
53
54
55
56
57
58
...
155
156
157
158
159
160
161





162
163
164
165
166
167
168
...
381
382
383
384
385
386
387









388
389
390
391
392
393
394
...
537
538
539
540
541
542
543





544
545
546
547
548
549
550
	isisometadata1.testcase \
	isisometadata2.testcase \
	isisometadata3.testcase \
	isisometadata4.testcase \
	isisometadata5.testcase \
	isisometadata6.testcase \
	isisometadata7.testcase \







	isschemavalidatedxmlblob1.testcase \
	isschemavalidatedxmlblob2.testcase \
	isschemavalidatedxmlblob3.testcase \
	isschemavalidatedxmlblob4.testcase \
	isschemavalidatedxmlblob5.testcase \
	isschemavalidatedxmlblob6.testcase \
	issldserststyle1.testcase \
................................................................................
	registerIsoMeta3.testcase \
	registerIsoMeta4.testcase \
	registerIsoMeta5.testcase \
	registerIsoMeta6.testcase \
	registerIsoMeta7.testcase \
	registerIsoMeta8.testcase \
	registerIsoMeta9.testcase \





	registerRaster1.testcase \
	registerRaster2.testcase \
	registerRaster3.testcase \
	registerRaster4.testcase \
	registerRaster5.testcase \
	registerRaster6.testcase \
	registerRaster7.testcase \
................................................................................
	reloadGroupStyle4.testcase \
	reloadGroupStyle5.testcase \
	reloadGroupStyle6.testcase \
	reloadGroupStyle7.testcase \
	reloadGroupStyle8.testcase \
	reloadGroupStyle9.testcase \
	reloadGroupStyle10.testcase \









	reloadRasterStyle1.testcase \
	reloadRasterStyle2.testcase \
	reloadRasterStyle3.testcase \
	reloadRasterStyle5.testcase \
	reloadRasterStyle6.testcase \
	reloadRasterStyle7.testcase \
	reloadRasterStyle8.testcase \
................................................................................
	unregisterGroupVector3.testcase \
	unregisterGroupVector4.testcase \
	unregisterGroupVector5.testcase \
	unregisterGroupVector6.testcase \
	unregisterGroupVector7.testcase \
	unregisterGroupVector8.testcase \
	unregisterGroupVector9.testcase \





	unregisterRaster1.testcase \
	unregisterRaster2.testcase \
	unregisterRaster3.testcase \
	unregisterRaster4.testcase \
	unregisterRaster5.testcase \
	unregisterRaster6.testcase \
	unregisterRaster7.testcase \







>
>
>
>
>
>
>







 







>
>
>
>
>







 







>
>
>
>
>
>
>
>
>







 







>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
...
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
...
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
	isisometadata1.testcase \
	isisometadata2.testcase \
	isisometadata3.testcase \
	isisometadata4.testcase \
	isisometadata5.testcase \
	isisometadata6.testcase \
	isisometadata7.testcase \
	ismapconfig1.testcase \
	ismapconfig2.testcase \
	ismapconfig3.testcase \
	ismapconfig4.testcase \
	ismapconfig5.testcase \
	ismapconfig6.testcase \
	ismapconfig7.testcase \
	isschemavalidatedxmlblob1.testcase \
	isschemavalidatedxmlblob2.testcase \
	isschemavalidatedxmlblob3.testcase \
	isschemavalidatedxmlblob4.testcase \
	isschemavalidatedxmlblob5.testcase \
	isschemavalidatedxmlblob6.testcase \
	issldserststyle1.testcase \
................................................................................
	registerIsoMeta3.testcase \
	registerIsoMeta4.testcase \
	registerIsoMeta5.testcase \
	registerIsoMeta6.testcase \
	registerIsoMeta7.testcase \
	registerIsoMeta8.testcase \
	registerIsoMeta9.testcase \
	registerMapConfig1.testcase \
	registerMapConfig2.testcase \
	registerMapConfig3.testcase \
	registerMapConfig4.testcase \
	registerMapConfig5.testcase \
	registerRaster1.testcase \
	registerRaster2.testcase \
	registerRaster3.testcase \
	registerRaster4.testcase \
	registerRaster5.testcase \
	registerRaster6.testcase \
	registerRaster7.testcase \
................................................................................
	reloadGroupStyle4.testcase \
	reloadGroupStyle5.testcase \
	reloadGroupStyle6.testcase \
	reloadGroupStyle7.testcase \
	reloadGroupStyle8.testcase \
	reloadGroupStyle9.testcase \
	reloadGroupStyle10.testcase \
	reloadMapConfig1.testcase \
	reloadMapConfig2.testcase \
	reloadMapConfig3.testcase \
	reloadMapConfig5.testcase \
	reloadMapConfig6.testcase \
	reloadMapConfig7.testcase \
	reloadMapConfig8.testcase \
	reloadMapConfig9.testcase \
	reloadMapConfig10.testcase \
	reloadRasterStyle1.testcase \
	reloadRasterStyle2.testcase \
	reloadRasterStyle3.testcase \
	reloadRasterStyle5.testcase \
	reloadRasterStyle6.testcase \
	reloadRasterStyle7.testcase \
	reloadRasterStyle8.testcase \
................................................................................
	unregisterGroupVector3.testcase \
	unregisterGroupVector4.testcase \
	unregisterGroupVector5.testcase \
	unregisterGroupVector6.testcase \
	unregisterGroupVector7.testcase \
	unregisterGroupVector8.testcase \
	unregisterGroupVector9.testcase \
	unregisterMapConfig1.testcase \
	unregisterMapConfig2.testcase \
	unregisterMapConfig3.testcase \
	unregisterMapConfig4.testcase \
	unregisterMapConfig5.testcase \
	unregisterRaster1.testcase \
	unregisterRaster2.testcase \
	unregisterRaster3.testcase \
	unregisterRaster4.testcase \
	unregisterRaster5.testcase \
	unregisterRaster6.testcase \
	unregisterRaster7.testcase \

Changes to test/sql_stmt_libxml2_tests/Makefile.in.

297
298
299
300
301
302
303







304
305
306
307
308
309
310
...
407
408
409
410
411
412
413





414
415
416
417
418
419
420
...
633
634
635
636
637
638
639









640
641
642
643
644
645
646
...
789
790
791
792
793
794
795





796
797
798
799
800
801
802
	isisometadata1.testcase \
	isisometadata2.testcase \
	isisometadata3.testcase \
	isisometadata4.testcase \
	isisometadata5.testcase \
	isisometadata6.testcase \
	isisometadata7.testcase \







	isschemavalidatedxmlblob1.testcase \
	isschemavalidatedxmlblob2.testcase \
	isschemavalidatedxmlblob3.testcase \
	isschemavalidatedxmlblob4.testcase \
	isschemavalidatedxmlblob5.testcase \
	isschemavalidatedxmlblob6.testcase \
	issldserststyle1.testcase \
................................................................................
	registerIsoMeta3.testcase \
	registerIsoMeta4.testcase \
	registerIsoMeta5.testcase \
	registerIsoMeta6.testcase \
	registerIsoMeta7.testcase \
	registerIsoMeta8.testcase \
	registerIsoMeta9.testcase \





	registerRaster1.testcase \
	registerRaster2.testcase \
	registerRaster3.testcase \
	registerRaster4.testcase \
	registerRaster5.testcase \
	registerRaster6.testcase \
	registerRaster7.testcase \
................................................................................
	reloadGroupStyle4.testcase \
	reloadGroupStyle5.testcase \
	reloadGroupStyle6.testcase \
	reloadGroupStyle7.testcase \
	reloadGroupStyle8.testcase \
	reloadGroupStyle9.testcase \
	reloadGroupStyle10.testcase \









	reloadRasterStyle1.testcase \
	reloadRasterStyle2.testcase \
	reloadRasterStyle3.testcase \
	reloadRasterStyle5.testcase \
	reloadRasterStyle6.testcase \
	reloadRasterStyle7.testcase \
	reloadRasterStyle8.testcase \
................................................................................
	unregisterGroupVector3.testcase \
	unregisterGroupVector4.testcase \
	unregisterGroupVector5.testcase \
	unregisterGroupVector6.testcase \
	unregisterGroupVector7.testcase \
	unregisterGroupVector8.testcase \
	unregisterGroupVector9.testcase \





	unregisterRaster1.testcase \
	unregisterRaster2.testcase \
	unregisterRaster3.testcase \
	unregisterRaster4.testcase \
	unregisterRaster5.testcase \
	unregisterRaster6.testcase \
	unregisterRaster7.testcase \







>
>
>
>
>
>
>







 







>
>
>
>
>







 







>
>
>
>
>
>
>
>
>







 







>
>
>
>
>







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
...
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
...
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
...
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
	isisometadata1.testcase \
	isisometadata2.testcase \
	isisometadata3.testcase \
	isisometadata4.testcase \
	isisometadata5.testcase \
	isisometadata6.testcase \
	isisometadata7.testcase \
	ismapconfig1.testcase \
	ismapconfig2.testcase \
	ismapconfig3.testcase \
	ismapconfig4.testcase \
	ismapconfig5.testcase \
	ismapconfig6.testcase \
	ismapconfig7.testcase \
	isschemavalidatedxmlblob1.testcase \
	isschemavalidatedxmlblob2.testcase \
	isschemavalidatedxmlblob3.testcase \
	isschemavalidatedxmlblob4.testcase \
	isschemavalidatedxmlblob5.testcase \
	isschemavalidatedxmlblob6.testcase \
	issldserststyle1.testcase \
................................................................................
	registerIsoMeta3.testcase \
	registerIsoMeta4.testcase \
	registerIsoMeta5.testcase \
	registerIsoMeta6.testcase \
	registerIsoMeta7.testcase \
	registerIsoMeta8.testcase \
	registerIsoMeta9.testcase \
	registerMapConfig1.testcase \
	registerMapConfig2.testcase \
	registerMapConfig3.testcase \
	registerMapConfig4.testcase \
	registerMapConfig5.testcase \
	registerRaster1.testcase \
	registerRaster2.testcase \
	registerRaster3.testcase \
	registerRaster4.testcase \
	registerRaster5.testcase \
	registerRaster6.testcase \
	registerRaster7.testcase \
................................................................................
	reloadGroupStyle4.testcase \
	reloadGroupStyle5.testcase \
	reloadGroupStyle6.testcase \
	reloadGroupStyle7.testcase \
	reloadGroupStyle8.testcase \
	reloadGroupStyle9.testcase \
	reloadGroupStyle10.testcase \
	reloadMapConfig1.testcase \
	reloadMapConfig2.testcase \
	reloadMapConfig3.testcase \
	reloadMapConfig5.testcase \
	reloadMapConfig6.testcase \
	reloadMapConfig7.testcase \
	reloadMapConfig8.testcase \
	reloadMapConfig9.testcase \
	reloadMapConfig10.testcase \
	reloadRasterStyle1.testcase \
	reloadRasterStyle2.testcase \
	reloadRasterStyle3.testcase \
	reloadRasterStyle5.testcase \
	reloadRasterStyle6.testcase \
	reloadRasterStyle7.testcase \
	reloadRasterStyle8.testcase \
................................................................................
	unregisterGroupVector3.testcase \
	unregisterGroupVector4.testcase \
	unregisterGroupVector5.testcase \
	unregisterGroupVector6.testcase \
	unregisterGroupVector7.testcase \
	unregisterGroupVector8.testcase \
	unregisterGroupVector9.testcase \
	unregisterMapConfig1.testcase \
	unregisterMapConfig2.testcase \
	unregisterMapConfig3.testcase \
	unregisterMapConfig4.testcase \
	unregisterMapConfig5.testcase \
	unregisterRaster1.testcase \
	unregisterRaster2.testcase \
	unregisterRaster3.testcase \
	unregisterRaster4.testcase \
	unregisterRaster5.testcase \
	unregisterRaster6.testcase \
	unregisterRaster7.testcase \

Added test/sql_stmt_libxml2_tests/ismapconfig1.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - NULL XmlBLOB
:memory: #use in-memory database
SELECT XB_IsMapConfig(NULL);
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(NULL)
-1

Added test/sql_stmt_libxml2_tests/ismapconfig2.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - INTEGER XmlBLOB
:memory: #use in-memory database
SELECT XB_IsMapConfig(1);
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(1)
-1

Added test/sql_stmt_libxml2_tests/ismapconfig3.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - DOUBLE XmlBLOB
:memory: #use in-memory database
SELECT XB_IsMapConfig(1.1);
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(1.1)
-1

Added test/sql_stmt_libxml2_tests/ismapconfig4.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - TEXT XmlBLOB
:memory: #use in-memory database
SELECT XB_IsMapConfig('alpha');
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig('alpha')
-1

Added test/sql_stmt_libxml2_tests/ismapconfig5.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - invalid XmlBLOB
:memory: #use in-memory database
SELECT XB_IsMapConfig(zeroblob(100));
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(zeroblob(100))
-1

Added test/sql_stmt_libxml2_tests/ismapconfig6.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - valid XmlBLOB (TRUE)
:memory: #use in-memory database
SELECT XB_IsMapConfig(x'008FACB9030000EC0100002B00BA687474703A2F2F7777772E676169612D6769732E69742F524C324D6170436F6E6669675F315F302E7873640000CA0000DA0100DE610100DB620100DC760000DDCB789C8D53C16EA330103D375F6179CF894973A922A04A93B65A296CA39076F7560D30106BC1666DD390BF5F63B24D88F650240B7BE6BD37E399B17FDF5625F940A5B914019D4E3C4A50A432E3A208E8EBEE697C47EFC391BF5DDF46502FA5C879412C45E880EE8DA9E78C1D0E8749011CC605D7136ED82594F6D879ABF9007F984DA42AD8ADE74DD9AF681DA77BAC60CC85362052A4570959F65C3BC85AA6609CE30BC1C91730EFD3776FD2EA8C86A31BFF07541882CFDCDF9E57A853C5EB2EA03DDEF83B6E4A0C139FF59BCEB448B451909AF0C3679F7B4B6543AE6F03BEB88376B4A8290DDFED15425768F2282029310BA8518DBD7D046DEFB345BEA3AC67D88C95267605F471133FCF679E37A364D118B95320742E553594E979CF280B05F59EA74B2955A6C92A8A039A43A9F1ACFC00E9EF42C9466464294BA902FA2D771F254EBC0685C25CE8FA6C70A14E63610CD81E652B30908046FD4FFCD3F14056C94661CEDB8002251B30FB80B667BDFF2974026B38A222BB638D013D549A0E65BA667532E48D6B6EAF7FCAD245FF5969478ECDB1EF57570F6325C9EB767D39437D291C61A3A491A92CC9DB790667760A4F882DE6688B91627CD406ABEB869C50DF2B28F0C9B6040C8978857DF2BCB3B25AD867F152C39F06878D60D7E9BAAA388B7D8183B10D477F013C69318BBC2BD51556DD');
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(x'008FACB9030000EC0100002B00BA687474703A2F2F7777772E676169612D6769732E69742F524C324D6170436F6E6669675F315F302E7873640000CA0000DA0100DE610100DB620100DC760000DDCB789C8D53C16EA330103D375F6179CF894973A922A04A93B65A296CA39076F7560D30106BC1666DD390BF5F63B24D88F650240B7BE6BD37E399B17FDF5625F940A5B914019D4E3C4A50A432E3A208E8EBEE697C47EFC391BF5DDF46502FA5C879412C45E880EE8DA9E78C1D0E8749011CC605D7136ED82594F6D879ABF9007F984DA42AD8ADE74DD9AF681DA77BAC60CC85362052A4570959F65C3BC85AA6609CE30BC1C91730EFD3776FD2EA8C86A31BFF07541882CFDCDF9E57A853C5EB2EA03DDEF83B6E4A0C139FF59BCEB448B451909AF0C3679F7B4B6543AE6F03BEB88376B4A8290DDFED15425768F2282029310BA8518DBD7D046DEFB345BEA3AC67D88C95267605F471133FCF679E37A364D118B95320742E553594E979CF280B05F59EA74B2955A6C92A8A039A43A9F1ACFC00E9EF42C9466464294BA902FA2D771F254EBC0685C25CE8FA6C70A14E63610CD81E652B30908046FD4FFCD3F14056C94661CEDB8002251B30FB80B667BDFF2974026B38A222BB638D013D549A0E65BA667532E48D6B6EAF7FCAD245FF5969478ECDB1EF57570F6325C9EB767D39437D291C61A3A491A92CC9DB790667760A4F882DE6688B91627CD406ABEB869C50DF2B28F0C9B6040C8978857DF2BCB3B25AD867F152C39F06878D60D7E9BAAA388B7D8183B10D477F013C69318BBC2BD51556DD')
1

Added test/sql_stmt_libxml2_tests/ismapconfig7.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
XB_IsMapConfig - valid XmlBLOB (FALSE)
:memory: #use in-memory database
SELECT XB_IsMapConfig(x'0001AB12000000120000000000BA0000CA0000DA0000DB0000DC0000DDCB3C613E3C623E746578743C2F623E3C2F613EBC49A10C93DD');
1 # rows (not including the header row)
1 # columns
XB_IsMapConfig(x'0001AB12000000120000000000BA0000CA0000DA0000DB0000DC0000DDCB3C613E3C623E746578743C2F623E3C2F613EBC49A10C93DD')
0

Added test/sql_stmt_libxml2_tests/registerMapConfig1.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
RegisterMapConfiguration - NULL config
:memory: #use in-memory database
SELECT RL2_RegisterMapConfiguration(NULL);
1 # rows (not including the header row)
1 # columns
RL2_RegisterMapConfiguration(NULL)
-1

Added test/sql_stmt_libxml2_tests/registerMapConfig2.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
RegisterMapConfiguration - Integer config
:memory: #use in-memory database
SELECT RL2_RegisterMapConfiguration(1);
1 # rows (not including the header row)
1 # columns
RL2_RegisterMapConfiguration(1)
-1

Added test/sql_stmt_libxml2_tests/registerMapConfig3.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
RegisterMapConfiguration - Double config
:memory: #use in-memory database
SELECT RL2_RegisterMapConfiguration(1.1);
1 # rows (not including the header row)
1 # columns
RL2_RegisterMapConfiguration(1.1)
-1

Added test/sql_stmt_libxml2_tests/registerMapConfig4.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
RegisterMapConfiguration - Text config
:memory: #use in-memory database
SELECT RL2_RegisterMapConfiguration('alpha');
1 # rows (not including the header row)
1 # columns
RL2_RegisterMapConfiguration('alpha')
-1

Added test/sql_stmt_libxml2_tests/registerMapConfig5.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
RegisterMapConfiguration - BLOB config
:memory: #use in-memory database
SELECT RL2_RegisterMapConfiguration(zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_RegisterMapConfiguration(zeroblob(100))
0

Added test/sql_stmt_libxml2_tests/reloadMapConfig1.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - NULL config_id
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration(NULL, zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration(NULL, zeroblob(100))
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig10.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Text config
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration('alpha', 'beta');
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration('alpha', 'beta')
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig2.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Double config_id
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration(1.1, zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration(1.1, zeroblob(100))
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig3.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - BLOB config_id
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration(zeroblob(100), zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration(zeroblob(100), zeroblob(100))
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig5.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Integet config_id
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration(1, zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration(1, zeroblob(100))
0

Added test/sql_stmt_libxml2_tests/reloadMapConfig6.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Text config_name
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration('alpha', zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration('alpha', zeroblob(100))
0

Added test/sql_stmt_libxml2_tests/reloadMapConfig7.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - NULL config
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration('alpha', NULL);
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration('alpha', NULL)
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig8.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Integer config
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration('alpha', -1);
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration('alpha', -1)
-1

Added test/sql_stmt_libxml2_tests/reloadMapConfig9.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
ReloadMapConfiguration - Double config
:memory: #use in-memory database
SELECT RL2_ReloadMapConfiguration('alpha', 1.1);
1 # rows (not including the header row)
1 # columns
RL2_ReloadMapConfiguration('alpha', 1.1)
-1

Added test/sql_stmt_libxml2_tests/unregisterMapConfig1.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
UnRegisterMapConfiguration - NULL config_id
:memory: #use in-memory database
SELECT RL2_UnRegisterMapConfiguration(NULL);
1 # rows (not including the header row)
1 # columns
RL2_UnRegisterMapConfiguration(NULL)
-1

Added test/sql_stmt_libxml2_tests/unregisterMapConfig2.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
UnRegisterMapConfiguration - DOUBLE config_id
:memory: #use in-memory database
SELECT RL2_UnRegisterMapConfiguration(1.1);
1 # rows (not including the header row)
1 # columns
RL2_UnRegisterMapConfiguration(1.1)
-1

Added test/sql_stmt_libxml2_tests/unregisterMapConfig3.testcase.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
UnRegisterMapConfiguration - BLOB config_id
:memory: #use in-memory database
SELECT RL2_UnRegisterMapConfiguration(zeroblob(100));
1 # rows (not including the header row)
1 # columns
RL2_UnRegisterMapConfiguration(zeroblob(100))
-1

Added test/sql_stmt_libxml2_tests/unregisterMapConfig4.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
UnRegisterMapConfiguration - Integer config_id
:memory: #use in-memory database
SELECT RL2_UnRegisterMapConfiguration(1);
1 # rows (not including the header row)
1 # columns
RL2_UnRegisterMapConfiguration(1)
0

Added test/sql_stmt_libxml2_tests/unregisterMapConfig5.testcase.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
UnRegisterMapConfiguration - Text config_name
:memory: #use in-memory database
SELECT RL2_UnRegisterMapConfiguration('alpha');
1 # rows (not including the header row)
1 # columns
RL2_UnRegisterMapConfiguration('alpha')
0

Changes to test/sql_stmt_tests/Makefile.

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
AS = as
AUTOCONF = autoconf
AUTOHEADER = autoheader
AUTOMAKE = automake-1.16
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -Wall -Wextra -Wunused -pedantic -g -O0 -fprofile-arcs -ftest-coverage -g
CPP = gcc -E
CPPFLAGS = 
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo







|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
AS = as
AUTOCONF = autoconf
AUTOHEADER = autoheader
AUTOMAKE = automake-1.16
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2 -fprofile-arcs -ftest-coverage -g
CPP = gcc -E
CPPFLAGS = 
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo