Open Geospatial Consortium Grammar

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Open Geospatial Consortium Grammar

Bill Petzke
Hello I know you get requests to help with grammars
all
the time but I am new to Spirit and EBNF. I am
attempting to parse an Open Geospatial Consortium
grammar for coordinate systems. The EBNF grammar
is as follows:

<coordinate system> ::=
<horz cs> | <local cs>

<horz cs> ::=
<geographic cs> | <projected cs>


<projected cs> ::=
PROJCS [ "<name>", <geographic cs>,
<projection>,
{<parameter>,}* <linear unit> ]

<projection> ::=
PROJECTION [ "<name>" ]

<parameter> ::=
PARAMETER [ "name", <number> ]

<geographic cs> ::=
GEOGCS [ "<name>", <datum>, <prime meridian>,
<angular unit> ]

<datum> ::=
DATUM [ "<name>", <spheroid>
{, <shift-x>, <shift-y>, <shift-z>
, <rot-x>, <rot-y>, <rot-z>, <scale_adjust>}
]

<spheroid> ::=
SPHEROID ["<name>", <semi major axis>,
<inverse flattening> ]

<prime meridian> ::=
PRIMEM ["<name>", <longitude> ]

<longitude> ::=
<number>

<semi-major axis> ::=
<number>

<inverse flattening> ::=
<number>

<angular unit> ::= <unit>

<linear unit> ::= <unit>

<unit> ::=
UNIT [ "<name>", <conversion factor> ]

<local cs> ::=
LOCAL_CS [ "<name>", <local datum>, <linear
unit>,
<axis> {, <axis>}* ]

<local datum> ::=
LOCAL_DATUM [ "<name>", <datum type>
{, <shift-x>, <shift-y>, <shift-z>
, <rot-x>, <rot-y>, <rot-z>, <scale_adjust>}
]

<datum type> ::=
<number>

<axis> ::=
AXIS [ "<name>", NORTH | SOUTH | EAST |
WEST | UP | DOWN | OTHER ]


My first attempt at a Spirit translation for this
grammar
is as follows:

coordinate_system = horz_cs | local_cs;
horz_cs =
geographic_cs | projected_cs;
projected_cs =
PROJCS [ "<name>", geographic_cs, projection,

{<parameter>,}* linear unit ];
projection =
PROJECTION [ "<name>" ];
parameter =
PARAMETER [ "name", number ];
geographic cs =
GEOGCS [ "<name>", datum, prime_meridian,
angular_unit ];
datum = DATUM
[ "<name>", spheroid {, shift-x, shift-y, shift-z ,
rot-x, rot-y,
rot-z, scale_adjust}];
spheroid = SPHEROID
["<name>", semi_major_axis, inverse_flattening ];
prime_meridian =
PRIMEM ["<name>", longitude ];
longitude> = number;
semi-major axis =
number;
inverse_flattening =
number;
angular_unit = unit;
linear_unit = unit;
unit = UNIT
[ "<name>", conversion_factor ];
local_cs = LOCAL_CS
[ "<name>", local_datum, linear_unit,

axis {, <axis>}* ];
local_datum =
LOCAL_DATUM [ "<name>", datum type

{, shift-x, shift-y, shift-z
,
rot-x, rot-y, rot-z, scale_adjust}
];
datum_type = number;
axis = AXIS
[ "<name>", NORTH | SOUTH | EAST |

WEST | UP | DOWN | OTHER ];

Any ideas or assistance would be appreciated.

Thanks
Bill Petzke

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Open Geospatial Consortium Grammar

Joel de Guzman-2
Bill Petzke wrote:
> Hello I know you get requests to help with grammars
> all
> the time but I am new to Spirit and EBNF. I am
> attempting to parse an Open Geospatial Consortium
> grammar for coordinate systems. The EBNF grammar
> is as follows:
>
[...]
>
> Any ideas or assistance would be appreciated.
>

Hi Bill,

It would be a good idea to ask for more specific questions.
It's hard to know exactly what you want. Sorry it took a long
time to reply. I simply did not know what to say.

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Re: Open Geospatial Consortium Grammar

Paul Giaccone
Bill Petzke wrote:

>> Hello I know you get requests to help with grammars
>> all the time but I am new to Spirit and EBNF. I am attempting to
>> parse an Open Geospatial Consortium grammar for coordinate systems.
>> The EBNF grammar is as follows:
>>
> [...]

Bill, if you are asking how to write this grammar in Spirit, then it
looks as though this would be a straightforward task.  If you haven't
already done so, I recommend you work through the examples, which will
demonstrate everything you need.

Paul



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general