| 1 | | # ============================================================================= |
|---|
| 2 | | # Python Cartographic Library. Copyright (C) 2004 Sean C. Gillies |
|---|
| 3 | | # |
|---|
| 4 | | # This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | # under the terms of the GNU General Public License as published by the Free |
|---|
| 6 | | # Software Foundation; either version 2 of the License, or (at your option) |
|---|
| 7 | | # any later version. |
|---|
| 8 | | # |
|---|
| 9 | | # This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 10 | | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 11 | | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|---|
| 12 | | # details. |
|---|
| 13 | | # |
|---|
| 14 | | # You should have received a copy of the GNU General Public License along with |
|---|
| 15 | | # this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|---|
| 16 | | # Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 | | # |
|---|
| 18 | | # Contact email: sgillies@frii.com |
|---|
| 19 | | # ============================================================================= |
|---|
| 20 | | |
|---|
| 21 | | from environment import * |
|---|
| 22 | | |
|---|
| 23 | | # ============================================================================ |
|---|
| 24 | | # Testing Geometries in WKB decoded from hex |
|---|
| 25 | | # ============================================================================ |
|---|
| 26 | | |
|---|
| 27 | | # point at 0, 0 |
|---|
| 28 | | POINTA = "010100000000000000000000000000000000000000".decode("hex") |
|---|
| 29 | | |
|---|
| 30 | | # point at 0.75, 0.75 |
|---|
| 31 | | POINTB = "0101000000000000000000E83F000000000000E83F".decode("hex") |
|---|
| 32 | | |
|---|
| 33 | | # both of the above points |
|---|
| 34 | | MULTIPOINT = "0104000000020000000101000000000000000000000000000000000000000101000000000000000000E83F000000000000E83F".decode('hex') |
|---|
| 35 | | |
|---|
| 36 | | # 4 unit long line |
|---|
| 37 | | # LINESTRING (-2 0, 2 0)' |
|---|
| 38 | | LINESTRING = "01020000000200000000000000000000C0000000000000000000000000000000400000000000000000".decode("hex") |
|---|
| 39 | | |
|---|
| 40 | | # same line as above, plus another crossing along the y axis |
|---|
| 41 | | MULTILINESTRING = "01050000000200000001020000000200000000000000000000C000000000000000000000000000000040000000000000000001020000000200000000000000000000000000000000000040000000000000000000000000000000C0".decode('hex') |
|---|
| 42 | | |
|---|
| 43 | | # 2 x 2 polygon with a 1 x 1 centered hole |
|---|
| 44 | | # POLYGON((-1 -1,-1 1,1 1,1 -1,-1 -1),(-0.5,-0.5,-0.5 0.5,0.5 0.5,0.5 -0.5,-0.5 -0.5)) |
|---|
| 45 | | POLYGON = '01030000000200000005000000000000000000F0BF000000000000F0BF000000000000F0BF000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000F0BF000000000000F0BF000000000000F0BF05000000000000000000E0BF000000000000E0BF000000000000E0BF000000000000E03F000000000000E03F000000000000E03F000000000000E03F000000000000E0BF000000000000E0BF000000000000E0BF'.decode('hex') |
|---|
| 46 | | |
|---|
| 47 | | # Same as above, plus a smaller single ring polygon to the upper right |
|---|
| 48 | | MULTIPOLYGON = '01060000000200000001030000000200000005000000000000000000F0BF000000000000F0BF000000000000F0BF000000000000F03F000000000000F03F000000000000F03F000000000000F03F000000000000F0BF000000000000F0BF000000000000F0BF05000000000000000000E0BF000000000000E0BF000000000000E0BF000000000000E03F000000000000E03F000000000000E03F000000000000E03F000000000000E0BF000000000000E0BF000000000000E0BF01030000000100000005000000000000000000F83F000000000000F83F000000000000F83F0000000000000040000000000000004000000000000000400000000000000040000000000000F83F000000000000F83F000000000000F83F'.decode('hex') |
|---|
| 49 | | |
|---|
| 50 | | |
|---|
| | 1 | # nothing needed for GeoRSS |
|---|