Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a static table to define axis order for some epsg codes (#3582)
git-svn-id: http://svn.osgeo.org/mapserver/trunk@11155 7532c77e-422f-0410-93f4-f0b67bdd69e2
- Loading branch information
Assefa Yewondwossen
committed
Mar 11, 2011
1 parent
7d1d0ba
commit 4ffda83
Showing
5 changed files
with
179 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
epsg_code,inverted | ||
3034,1 | ||
3035,1 | ||
3042,1 | ||
3043,1 | ||
4326,1 | ||
4559,1 | ||
4471,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/****************************************************************************** | ||
* $Id: $ | ||
* | ||
* Project: MapServer | ||
* Purpose: Axis lookup table | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 1996-2005 Regents of the University of Minnesota. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a | ||
* copy of this software and associated documentation files (the "Software"), | ||
* to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
* and/or sell copies of the Software, and to permit persons to whom the | ||
* Software is furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies of this Software or works derived from this Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
* DEALINGS IN THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
/* | ||
* Generated file | ||
* | ||
* This file was generated from by means of a script. Do not edit manually. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
static struct axisOrientationEpsgCodes_s { | ||
int code; | ||
int inverted; /*true=1, false =0*/ | ||
} axisOrientationEpsgCodes[] = { | ||
{3034,1}, | ||
{3035,1}, | ||
{3042,1}, | ||
{3043,1}, | ||
{4326,1}, | ||
{4559,1}, | ||
{4471,0}, | ||
}; | ||
|
||
#define AXIS_ORIENTATION_TABLE_SIZE 8 | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
INFILE="./mapaxisorder.csv" | ||
OUTFILE="./mapaxisorder.h" | ||
|
||
# create array of elements from $INFILE | ||
unset ARRAY i | ||
while read -r LINE; do ARRAY[i++]=$LINE; done < $INFILE | ||
|
||
print_header () | ||
{ | ||
|
||
echo '/******************************************************************************' | ||
echo ' * $Id: $' | ||
echo ' *' | ||
echo ' * Project: MapServer' | ||
echo ' * Purpose: Axis lookup table' | ||
echo ' *' | ||
echo ' ******************************************************************************' | ||
echo ' * Copyright (c) 1996-2005 Regents of the University of Minnesota.' | ||
echo ' *' | ||
echo ' * Permission is hereby granted, free of charge, to any person obtaining a' | ||
echo ' * copy of this software and associated documentation files (the "Software"),' | ||
echo ' * to deal in the Software without restriction, including without limitation' | ||
echo ' * the rights to use, copy, modify, merge, publish, distribute, sublicense,' | ||
echo ' * and/or sell copies of the Software, and to permit persons to whom the' | ||
echo ' * Software is furnished to do so, subject to the following conditions:' | ||
echo ' *' | ||
echo ' * The above copyright notice and this permission notice shall be included in ' | ||
echo ' * all copies of this Software or works derived from this Software.' | ||
echo ' *' | ||
echo ' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS' | ||
echo ' * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,' | ||
echo ' * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL' | ||
echo ' * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER' | ||
echo ' * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING' | ||
echo ' * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER' | ||
echo ' * DEALINGS IN THE SOFTWARE.' | ||
echo ' ****************************************************************************/' | ||
|
||
} | ||
|
||
print_comment () | ||
{ | ||
echo ' ' | ||
echo '/*' | ||
echo ' * Generated file' | ||
echo ' *' | ||
echo ' * This file was generated from by means of a script. Do not edit manually.' | ||
echo ' */' | ||
echo ' ' | ||
|
||
} | ||
|
||
print_body () | ||
{ | ||
|
||
echo '#ifdef __cplusplus' | ||
echo 'extern "C" '{ | ||
echo '#endif' | ||
echo ' ' | ||
echo 'static struct axisOrientationEpsgCodes_s {' | ||
echo ' int code;' | ||
echo ' int inverted; /*true=1, false =0*/' | ||
echo '} axisOrientationEpsgCodes[] = {' | ||
|
||
# unset first array element | ||
unset ARRAY[0] | ||
# traverse array and print out elements | ||
for x in "${ARRAY[@]}"; do | ||
echo " {${x}}," | ||
done | ||
|
||
echo '};' | ||
echo ' ' | ||
echo '#define AXIS_ORIENTATION_TABLE_SIZE 8' | ||
echo ' ' | ||
echo '#ifdef __cplusplus' | ||
echo '}' | ||
echo '#endif' | ||
|
||
} | ||
|
||
print_header > ./$OUTFILE | ||
print_comment >> ./$OUTFILE | ||
print_body >> ./$OUTFILE | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters