File: using_postgis_app.xml.pot

package info (click to toggle)
postgis 2.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 58,660 kB
  • ctags: 10,181
  • sloc: ansic: 132,858; sql: 131,148; xml: 46,460; sh: 4,832; perl: 4,476; makefile: 2,749; python: 1,198; yacc: 442; lex: 131
file content (659 lines) | stat: -rw-r--r-- 22,010 bytes parent folder | download | duplicates (2)
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
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
# SOME DESCRIPTIVE TITLE.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2016-07-04 13:02+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. Tag: title
#: using_postgis_app.xml:3
#, no-c-format
msgid "Using PostGIS Geometry: Building Applications"
msgstr ""

#. Tag: title
#: using_postgis_app.xml:5
#, no-c-format
msgid "Using MapServer"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:7
#, no-c-format
msgid "The Minnesota MapServer is an internet web-mapping server which conforms to the OpenGIS Web Mapping Server specification."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:12
#, no-c-format
msgid "The MapServer homepage is at <ulink url=\"http://mapserver.org\">http://mapserver.org</ulink>."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:17
#, no-c-format
msgid "The OpenGIS Web Map Specification is at <ulink url=\"http://www.opengeospatial.org/standards/wms\">http://www.opengeospatial.org/standards/wms</ulink>."
msgstr ""

#. Tag: title
#: using_postgis_app.xml:23
#, no-c-format
msgid "Basic Usage"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:25
#, no-c-format
msgid "To use PostGIS with MapServer, you will need to know about how to configure MapServer, which is beyond the scope of this documentation. This section will cover specific PostGIS issues and configuration details."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:30
#, no-c-format
msgid "To use PostGIS with MapServer, you will need:"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:34
#, no-c-format
msgid "Version 0.6 or newer of PostGIS."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:38
#, no-c-format
msgid "Version 3.5 or newer of MapServer."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:42
#, no-c-format
msgid "MapServer accesses PostGIS/PostgreSQL data like any other PostgreSQL client -- using the <filename>libpq</filename> interface. This means that MapServer can be installed on any machine with network access to the PostGIS server, and use PostGIS as a source of data. The faster the connection between the systems, the better."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:50
#, no-c-format
msgid "Compile and install MapServer, with whatever options you desire, including the \"--with-postgis\" configuration option."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:55
#, no-c-format
msgid "In your MapServer map file, add a PostGIS layer. For example:"
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:58
#, no-c-format
msgid ""
      "LAYER\n"
      "  CONNECTIONTYPE postgis\n"
      "  NAME \"widehighways\"\n"
      "  # Connect to a remote spatial database\n"
      "  CONNECTION \"user=dbuser dbname=gisdatabase host=bigserver\"\n"
      "  PROCESSING \"CLOSE_CONNECTION=DEFER\"\n"
      "  # Get the lines from the 'geom' column of the 'roads' table\n"
      "  DATA \"geom from roads using srid=4326 using unique gid\"\n"
      "  STATUS ON\n"
      "  TYPE LINE\n"
      "  # Of the lines in the extents, only render the wide highways\n"
      "  FILTER \"type = 'highway' and numlanes &gt;= 4\"\n"
      "  CLASS\n"
      "    # Make the superhighways brighter and 2 pixels wide\n"
      "    EXPRESSION ([numlanes] &gt;= 6)\n"
      "    STYLE\n"
      "      COLOR 255 22 22\n"
      "      WIDTH 2\n"
      "    END\n"
      "  END\n"
      "  CLASS\n"
      "    # All the rest are darker and only 1 pixel wide\n"
      "    EXPRESSION ([numlanes] &lt; 6)\n"
      "    STYLE\n"
      "      COLOR 205 92 82\n"
      "    END\n"
      "  END\n"
      "END"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:60
#, no-c-format
msgid "In the example above, the PostGIS-specific directives are as follows:"
msgstr ""

#. Tag: term
#: using_postgis_app.xml:65
#, no-c-format
msgid "CONNECTIONTYPE"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:68
#, no-c-format
msgid "For PostGIS layers, this is always \"postgis\"."
msgstr ""

#. Tag: term
#: using_postgis_app.xml:73
#, no-c-format
msgid "CONNECTION"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:76
#, no-c-format
msgid "The database connection is governed by the a 'connection string' which is a standard set of keys and values like this (with the default values in &lt;&gt;):"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:80
#, no-c-format
msgid "user=&lt;username&gt; password=&lt;password&gt; dbname=&lt;username&gt; hostname=&lt;server&gt; port=&lt;5432&gt;"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:84
#, no-c-format
msgid "An empty connection string is still valid, and any of the key/value pairs can be omitted. At a minimum you will generally supply the database name and username to connect with."
msgstr ""

#. Tag: term
#: using_postgis_app.xml:92
#, no-c-format
msgid "DATA"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:95
#, no-c-format
msgid "The form of this parameter is \"&lt;geocolumn&gt; from &lt;tablename&gt; using srid=&lt;srid&gt; using unique &lt;primary key&gt;\" where the column is the spatial column to be rendered to the map, the SRID is SRID used by the column and the primary key is the table primary key (or any other uniquely-valued column with an index)."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:99
#, no-c-format
msgid "You can omit the \"using srid\" and \"using unique\" clauses and MapServer will automatically determine the correct values if possible, but at the cost of running a few extra queries on the server for each map draw."
msgstr ""

#. Tag: term
#: using_postgis_app.xml:106
#, no-c-format
msgid "PROCESSING"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:109
#, no-c-format
msgid "Putting in a CLOSE_CONNECTION=DEFER if you have multiple layers reuses existing connections instead of closing them. This improves speed. Refer to for <ulink url=\"http://blog.cleverelephant.ca/2008/10/mapserverpostgis-performance-tips.html\">MapServer PostGIS Performance Tips</ulink> for a more detailed explanation."
msgstr ""

#. Tag: term
#: using_postgis_app.xml:115
#, no-c-format
msgid "FILTER"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:118
#, no-c-format
msgid "The filter must be a valid SQL string corresponding to the logic normally following the \"WHERE\" keyword in a SQL query. So, for example, to render only roads with 6 or more lanes, use a filter of \"num_lanes &gt;= 6\"."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:128
#, no-c-format
msgid "In your spatial database, ensure you have spatial (GiST) indexes built for any the layers you will be drawing."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:131
#, no-c-format
msgid "CREATE INDEX [indexname] ON [tablename] USING GIST ( [geometrycolumn] );"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:135
#, no-c-format
msgid "If you will be querying your layers using MapServer you will also need to use the \"using unique\" clause in your DATA statement."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:138
#, no-c-format
msgid "MapServer requires unique identifiers for each spatial record when doing queries, and the PostGIS module of MapServer uses the unique value you specify in order to provide these unique identifiers. Using the table primary key is the best practice."
msgstr ""

#. Tag: title
#: using_postgis_app.xml:147
#, no-c-format
msgid "Frequently Asked Questions"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:152
#, no-c-format
msgid "When I use an <varname>EXPRESSION</varname> in my map file, the condition never returns as true, even though I know the values exist in my table."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:158
#, no-c-format
msgid "Unlike shape files, PostGIS field names have to be referenced in EXPRESSIONS using <emphasis>lower case</emphasis>."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:162
#, no-c-format
msgid "EXPRESSION ([numlanes] &gt;= 6)"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:168
#, no-c-format
msgid "The FILTER I use for my Shape files is not working for my PostGIS table of the same data."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:173
#, no-c-format
msgid "Unlike shape files, filters for PostGIS layers use SQL syntax (they are appended to the SQL statement the PostGIS connector generates for drawing layers in MapServer)."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:177
#, no-c-format
msgid "FILTER \"type = 'highway' and numlanes &gt;= 4\""
msgstr ""

#. Tag: para
#: using_postgis_app.xml:183
#, no-c-format
msgid "My PostGIS layer draws much slower than my Shape file layer, is this normal?"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:188
#, no-c-format
msgid "In general, the more features you are drawing into a given map, the more likely it is that PostGIS will be slower than Shape files. For maps with relatively few features (100s), PostGIS will often be faster. For maps with high feature density (1000s), PostGIS will always be slower."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:194
#, no-c-format
msgid "If you are finding substantial draw performance problems, it is possible that you have not built a spatial index on your table."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:198
#, no-c-format
msgid ""
      "postgis# CREATE INDEX geotable_gix ON geotable USING GIST ( geocolumn );\n"
      "postgis# VACUUM ANALYZE;"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:204
#, no-c-format
msgid "My PostGIS layer draws fine, but queries are really slow. What is wrong?"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:209
#, no-c-format
msgid "For queries to be fast, you must have a unique key for your spatial table and you must have an index on that unique key."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:213
#, no-c-format
msgid "You can specify what unique key for mapserver to use with the <varname>USING UNIQUE</varname> clause in your <varname>DATA</varname> line:"
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:217
#, no-c-format
msgid "DATA \"geom FROM geotable USING UNIQUE gid\""
msgstr ""

#. Tag: para
#: using_postgis_app.xml:224
#, no-c-format
msgid "Can I use \"geography\" columns (new in PostGIS 1.5) as a source for MapServer layers?"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:229
#, no-c-format
msgid "Yes! MapServer understands geography columns as being the same as geometry columns, but always using an SRID of 4326. Just make sure to include a \"using srid=4326\" clause in your <varname>DATA</varname> statement. Everything else works exactly the same as with geometry."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:234
#, no-c-format
msgid "DATA \"geog FROM geogtable USING SRID=4326 USING UNIQUE gid\""
msgstr ""

#. Tag: title
#: using_postgis_app.xml:244
#, no-c-format
msgid "Advanced Usage"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:246
#, no-c-format
msgid "The <varname>USING</varname> pseudo-SQL clause is used to add some information to help mapserver understand the results of more complex queries. More specifically, when either a view or a subselect is used as the source table (the thing to the right of \"FROM\" in a <varname>DATA</varname> definition) it is more difficult for mapserver to automatically determine a unique identifier for each row and also the SRID for the table. The <varname>USING</varname> clause can provide mapserver with these two pieces of information as follows:"
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:255
#, no-c-format
msgid ""
      "DATA \"geom FROM (\n"
      "  SELECT\n"
      "    table1.geom AS geom,\n"
      "    table1.gid AS gid,\n"
      "    table2.data AS data\n"
      "  FROM table1\n"
      "  LEFT JOIN table2\n"
      "  ON table1.id = table2.id\n"
      ") AS new_table USING UNIQUE gid USING SRID=4326\""
msgstr ""

#. Tag: term
#: using_postgis_app.xml:259
#, no-c-format
msgid "USING UNIQUE &lt;uniqueid&gt;"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:262
#, no-c-format
msgid "MapServer requires a unique id for each row in order to identify the row when doing map queries. Normally it identifies the primary key from the system tables. However, views and subselects don't automatically have an known unique column. If you want to use MapServer's query functionality, you need to ensure your view or subselect includes a uniquely valued column, and declare it with <varname>USING UNIQUE</varname>. For example, you could explicitly select nee of the table's primary key values for this purpose, or any other column which is guaranteed to be unique for the result set."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:273
#, no-c-format
msgid "\"Querying a Map\" is the action of clicking on a map to ask for information about the map features in that location. Don't confuse \"map queries\" with the SQL query in a <varname>DATA</varname> definition."
msgstr ""

#. Tag: term
#: using_postgis_app.xml:282
#, no-c-format
msgid "USING SRID=&lt;srid&gt;"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:285
#, no-c-format
msgid "PostGIS needs to know which spatial referencing system is being used by the geometries in order to return the correct data back to MapServer. Normally it is possible to find this information in the \"geometry_columns\" table in the PostGIS database, however, this is not possible for tables which are created on the fly such as subselects and views. So the <varname>USING SRID=</varname> option allows the correct SRID to be specified in the <varname>DATA</varname> definition."
msgstr ""

#. Tag: title
#: using_postgis_app.xml:300
#, no-c-format
msgid "Examples"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:302
#, no-c-format
msgid "Lets start with a simple example and work our way up. Consider the following MapServer layer definition:"
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:305
#, no-c-format
msgid ""
      "LAYER\n"
      "  CONNECTIONTYPE postgis\n"
      "  NAME \"roads\"\n"
      "  CONNECTION \"user=theuser password=thepass dbname=thedb host=theserver\"\n"
      "  DATA \"geom from roads\"\n"
      "  STATUS ON\n"
      "  TYPE LINE\n"
      "  CLASS\n"
      "    STYLE\n"
      "      COLOR 0 0 0\n"
      "    END\n"
      "  END\n"
      "END"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:307
#, no-c-format
msgid "This layer will display all the road geometries in the roads table as black lines."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:310
#, no-c-format
msgid "Now lets say we want to show only the highways until we get zoomed in to at least a 1:100000 scale - the next two layers will achieve this effect:"
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:314
#, no-c-format
msgid ""
      "LAYER\n"
      "  CONNECTIONTYPE postgis\n"
      "  CONNECTION \"user=theuser password=thepass dbname=thedb host=theserver\"\n"
      "  PROCESSING \"CLOSE_CONNECTION=DEFER\"\n"
      "  DATA \"geom from roads\"\n"
      "  MINSCALE 100000\n"
      "  STATUS ON\n"
      "  TYPE LINE\n"
      "  FILTER \"road_type = 'highway'\"\n"
      "  CLASS\n"
      "    COLOR 0 0 0\n"
      "  END\n"
      "END\n"
      "LAYER\n"
      "  CONNECTIONTYPE postgis\n"
      "  CONNECTION \"user=theuser password=thepass dbname=thedb host=theserver\"\n"
      "  PROCESSING \"CLOSE_CONNECTION=DEFER\"\n"
      "  DATA \"geom from roads\"\n"
      "  MAXSCALE 100000\n"
      "  STATUS ON\n"
      "  TYPE LINE\n"
      "  CLASSITEM road_type\n"
      "  CLASS\n"
      "    EXPRESSION \"highway\"\n"
      "    STYLE\n"
      "      WIDTH 2\n"
      "      COLOR 255 0 0\n"
      "    END\n"
      "  END\n"
      "  CLASS\n"
      "    STYLE\n"
      "      COLOR 0 0 0\n"
      "    END\n"
      "  END\n"
      "END"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:316
#, no-c-format
msgid "The first layer is used when the scale is greater than 1:100000, and displays only the roads of type \"highway\" as black lines. The <varname>FILTER</varname> option causes only roads of type \"highway\" to be displayed."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:321
#, no-c-format
msgid "The second layer is used when the scale is less than 1:100000, and will display highways as double-thick red lines, and other roads as regular black lines."
msgstr ""

#. Tag: para
#: using_postgis_app.xml:325
#, no-c-format
msgid "So, we have done a couple of interesting things using only MapServer functionality, but our <varname>DATA</varname> SQL statement has remained simple. Suppose that the name of the road is stored in another table (for whatever reason) and we need to do a join to get it and label our roads."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:331
#, no-c-format
msgid ""
      "LAYER\n"
      "  CONNECTIONTYPE postgis\n"
      "  CONNECTION \"user=theuser password=thepass dbname=thedb host=theserver\"\n"
      "  DATA \"geom FROM (SELECT roads.gid AS gid, roads.geom AS geom,\n"
      "        road_names.name as name FROM roads LEFT JOIN road_names ON\n"
      "        roads.road_name_id = road_names.road_name_id)\n"
      "        AS named_roads USING UNIQUE gid USING SRID=4326\"\n"
      "  MAXSCALE 20000\n"
      "  STATUS ON\n"
      "  TYPE ANNOTATION\n"
      "  LABELITEM name\n"
      "  CLASS\n"
      "    LABEL\n"
      "      ANGLE auto\n"
      "      SIZE 8\n"
      "      COLOR 0 192 0\n"
      "      TYPE truetype\n"
      "      FONT arial\n"
      "    END\n"
      "  END\n"
      "END"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:333
#, no-c-format
msgid "This annotation layer adds green labels to all the roads when the scale gets down to 1:20000 or less. It also demonstrates how to use an SQL join in a <varname>DATA</varname> definition."
msgstr ""

#. Tag: title
#: using_postgis_app.xml:340
#, no-c-format
msgid "Java Clients (JDBC)"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:342
#, no-c-format
msgid "Java clients can access PostGIS \"geometry\" objects in the PostgreSQL database either directly as text representations or using the JDBC extension objects bundled with PostGIS. In order to use the extension objects, the \"postgis.jar\" file must be in your CLASSPATH along with the \"postgresql.jar\" JDBC driver package."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:348
#, no-c-format
msgid ""
      "import java.sql.*;\n"
      "import java.util.*;\n"
      "import java.lang.*;\n"
      "import org.postgis.*;\n"
      "\n"
      "public class JavaGIS {\n"
      "\n"
      "public static void main(String[] args) {\n"
      "\n"
      "  java.sql.Connection conn;\n"
      "\n"
      "  try {\n"
      "    /*\n"
      "    * Load the JDBC driver and establish a connection.\n"
      "    */\n"
      "    Class.forName(\"org.postgresql.Driver\");\n"
      "    String url = \"jdbc:postgresql://localhost:5432/database\";\n"
      "    conn = DriverManager.getConnection(url, \"postgres\", \"\");\n"
      "    /*\n"
      "    * Add the geometry types to the connection. Note that you\n"
      "    * must cast the connection to the pgsql-specific connection\n"
      "    * implementation before calling the addDataType() method.\n"
      "    */\n"
      "    ((org.postgresql.PGConnection)conn).addDataType(\"geometry\",Class.forName(\"org.postgis.PGgeometry\"));\n"
      "    ((org.postgresql.PGConnection)conn).addDataType(\"box3d\",Class.forName(\"org.postgis.PGbox3d\"));\n"
      "    /*\n"
      "    * Create a statement and execute a select query.\n"
      "    */\n"
      "    Statement s = conn.createStatement();\n"
      "    ResultSet r = s.executeQuery(\"select geom,id from geomtable\");\n"
      "    while( r.next() ) {\n"
      "      /*\n"
      "      * Retrieve the geometry as an object then cast it to the geometry type.\n"
      "      * Print things out.\n"
      "      */\n"
      "      PGgeometry geom = (PGgeometry)r.getObject(1);\n"
      "      int id = r.getInt(2);\n"
      "      System.out.println(\"Row \" + id + \":\");\n"
      "      System.out.println(geom.toString());\n"
      "    }\n"
      "    s.close();\n"
      "    conn.close();\n"
      "  }\n"
      "catch( Exception e ) {\n"
      "  e.printStackTrace();\n"
      "  }\n"
      "}\n"
      "}"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:350
#, no-c-format
msgid "The \"PGgeometry\" object is a wrapper object which contains a specific topological geometry object (subclasses of the abstract class \"Geometry\") depending on the type: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon."
msgstr ""

#. Tag: programlisting
#: using_postgis_app.xml:355
#, no-c-format
msgid ""
      "PGgeometry geom = (PGgeometry)r.getObject(1);\n"
      "if( geom.getType() == Geometry.POLYGON ) {\n"
      "  Polygon pl = (Polygon)geom.getGeometry();\n"
      "  for( int r = 0; r &lt; pl.numRings(); r++) {\n"
      "    LinearRing rng = pl.getRing(r);\n"
      "    System.out.println(\"Ring: \" + r);\n"
      "    for( int p = 0; p &lt; rng.numPoints(); p++ ) {\n"
      "      Point pt = rng.getPoint(p);\n"
      "      System.out.println(\"Point: \" + p);\n"
      "      System.out.println(pt.toString());\n"
      "    }\n"
      "  }\n"
      "}"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:357
#, no-c-format
msgid "The JavaDoc for the extension objects provides a reference for the various data accessor functions in the geometric objects."
msgstr ""

#. Tag: title
#: using_postgis_app.xml:362
#, no-c-format
msgid "C Clients (libpq)"
msgstr ""

#. Tag: para
#: using_postgis_app.xml:364 using_postgis_app.xml:369 using_postgis_app.xml:375
#, no-c-format
msgid "<para>...</para>"
msgstr ""

#. Tag: title
#: using_postgis_app.xml:367
#, no-c-format
msgid "Text Cursors"
msgstr ""

#. Tag: title
#: using_postgis_app.xml:373
#, no-c-format
msgid "Binary Cursors"
msgstr ""