[Mapserver-users] Using OS MasterMap with MapServer

Andrew Haigh andrew at andrewhaigh.net
Sat Jun 12 11:39:11 EDT 2004


--Apple-Mail-1--774114367
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=GB2312;
	format=flowed

According to the GDAL site (http://gdal.maptools.org/ogr/drv_gml.html),=20=

OGR supports GML Version 2.0 and MasterMap is supplied in GML 2.1.2=20
(see www.opengis.org for details of the spec).

I'd start be attempting to read the MasterMap GML using the OGR/GDAL=20
GML reader and see if that works.

If it does work, then you might want to try and convert the GML to a=20
Shapefile / postgis using ogr2ogr, to see if that improves performance.

If that doesn't work, then you'll have to code something - PHP 'may' be=20=

the ideal tool, as it support gzip and xml.

You'll have to ask the PHP guys if you can stream a GZIP file, into PHP=20=

(as you can in Java) or you'll need loads of RAM.

If you wanted to load GML into a database (PostgreSQL with PostGIS)=20
then you could try these steps:

1. Decompresses the GML (as it comes with GZIP compression) - although,=20=

using a stream would be much better (unless you have a very small=20
dataset)

2. Reads the GML (XML) and convert it to OGC Simple Features - you'll=20
need to read the very long MasterMap Spec and split out the Polygon,=20
Line, point and annotation features

3. Load the OGC Simple Feature into a Spatial Database - PostgreSQL=20
(with PostGIS), MySQL?

4. Index the TOID (Topographic Identifier)  and the geometry - this=20
will be used for updates

5. Log rejected features

6. You'd need some code to apply the update files from the OS - If your=20=

client has the  MasterMap supplied as Change Only Update (COU).

If it could work with your end product (and the OS License), the OS=20
provides a GML to SVG (Scaleable Vector Graphics) Stylesheet on it's=20
website.

I think that most commercial organizations and even the OS would=20
recommend loading the data into a DBMS - be warned unless you have a=20
very small area of data, the database will be huge.

Also, look at FME - it can convert most things=20
(http://www.safe.com/products/fme/formats/index.php).

Hope this helps.

Andrew

On 12 Jun 2004, at 12:06, guoloi dou wrote:

> Thank you for your reply. I'm afraid that MasterMap is in GML. Do you=20=

> mean that OGR/GDAL may read GML MasterMap? If not, what do you=20
> recommend that GML should be converted to?
> =20
> Regards,
>
> Zhengda Lu
> =20
>
>
> Andrew Haigh <andrew at andrewhaigh.net> wrote:
> It all depends what format your MasterMap is in? GML? Shapefile?
>  MapInfo Tab?
>
> Getting MasterMap. to work from a shapefile is easy, however, if your
>  data is GML then I think you'll need convert it.
>
> You might be able to read it in via OGR/GDAL but I've never tried it
> (www.remotesensing.org/gdal/), if your using the none topographically
>  structured version.
>
> If you look on the OS website
>  (http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/
>  systems/index.html) this will tell you what software claims to be
> compatabile.
>
> Not sure if this is helpful or not.
>
> Regards,
>
> Andrew
>
> On 10 Jun 2004, at 13:52, guoloi dou wrote:
>
> > I am new to GIS and am trying to implement a web-based navigation
>  > system to display Ordnance Survey MasterMap data. Below=A0are the
>  > technologies availabe:
> > 1.PHP;
> > 2.MySQL;
> > 3.OS MasterMap
> > 4.MapServer
> > 5.Apache on Windows XP
> > ?lt;br>> Could someone tell me how MasterMap be used by MapServer so=20=

> that I can
>  > extract location information from MapServer and MySQL?
> > ?lt;br>> Your help would be appreciated
> > ?lt;br>> Best regards,
> > Zhengda Lu
> >
>
>
>
> Do You Yahoo!?
> =CF=D3=D3=CA=CF=E4=CC=AB=D0=A1=A3=BF=D1=C5=BB=A2=B5=E7=D3=CA=D7=D4=D6=FA=
=C0=A9=C8=DD=A3=A1=

--Apple-Mail-1--774114367
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=GB2312

According to the GDAL site
(http://gdal.maptools.org/ogr/drv_gml.html), OGR supports GML Version
2.0 and MasterMap is supplied in GML 2.1.2 (see www.opengis.org for
details of the spec).


I'd start be attempting to read the MasterMap GML using the OGR/GDAL
GML reader and see if that works.


If it does work, then you might want to try and convert the GML to a
Shapefile / postgis using ogr2ogr, to see if that improves performance.


If that doesn't work, then you'll have to code something - PHP 'may'
be the ideal tool, as it support gzip and xml.=20


You'll have to ask the PHP guys if you can stream a GZIP file, into
PHP (as you can in Java) or you'll need loads of RAM.


If you wanted to load GML into a database (PostgreSQL with PostGIS)
then you could try these steps:


1. Decompresses the GML (as it comes with GZIP compression) -
although, using a stream would be much better (unless you have a very
small dataset)


2. Reads the GML (XML) and convert it to OGC Simple Features - you'll
need to read the very long MasterMap Spec and split out the Polygon,
Line, point and annotation features


3. Load the OGC Simple Feature into a Spatial Database - PostgreSQL
(with PostGIS), MySQL?


4. Index the TOID (Topographic Identifier)  and the geometry - this
will be used for updates


5. Log rejected features


6. You'd need some code to apply the update files from the OS - If
your client has the  MasterMap supplied as Change Only Update (COU).


If it could work with your end product (and the OS License), the OS
provides a GML to SVG (Scaleable Vector Graphics) Stylesheet on it's
website.


I think that most commercial organizations and even the OS would
recommend loading the data into a DBMS - be warned unless you have a
very small area of data, the database will be huge.


Also, look at FME - it can convert most things
(http://www.safe.com/products/fme/formats/index.php).


Hope this helps.


Andrew


On 12 Jun 2004, at 12:06, guoloi dou wrote:


<excerpt>Thank you for your reply. I'm afraid that MasterMap is in
GML. Do you mean that OGR/GDAL may read GML MasterMap? If not, what do
you recommend that GML should be converted to?

=20

Regards,


Zhengda Lu

=20



<bold><italic>Andrew Haigh <<andrew at andrewhaigh.net></italic></bold>
wrote:

It all depends what format your MasterMap is in? GML? Shapefile?

 MapInfo Tab?


Getting MasterMap. to work from a shapefile is easy, however, if your

 data is GML then I think you'll need convert it.


You might be able to read it in via OGR/GDAL but I've never tried it=20

(www.remotesensing.org/gdal/), if your using the none topographically

 structured version.


If you look on the OS website

 (http://www.ordnancesurvey.co.uk/oswebsite/products/osmastermap/

 systems/index.html) this will tell you what software claims to be=20

compatabile.


Not sure if this is helpful or not.


Regards,


Andrew


On 10 Jun 2004, at 13:52, guoloi dou wrote:


> I am new to GIS and am trying to implement a web-based navigation

 > system to display Ordnance Survey MasterMap data.
Below<fontfamily><param>Hiragino Kaku Gothic =
Pro</param>=A0a</fontfamily>re
the

 > technologies availabe:

> 1.PHP;

> 2.MySQL;

> 3.OS MasterMap

> 4.MapServer

> 5.Apache on Windows XP

> ?lt;br>> Could someone tell me how MasterMap be used by MapServer so
that I can

 > extract location information from MapServer and MySQL?

> ?lt;br>> Your help would be appreciated

> ?lt;br>> Best regards,

> Zhengda Lu

>




<bold>Do You Yahoo!?</bold>

<fontfamily><param>Hiragino Kaku Gothic =
Pro</param><color><param>0000,0000,EEEE</param>=CF=D3</color></fontfamily>=
<fontfamily><param>STHeiti</param><color><param>0000,0000,EEEE</param>=D3=CA=
=CF=E4=CC=AB=D0=A1=A3=BF=D1=C5=BB=A2=B5=E7=D3=CA=D7=D4=D6=FA=C0=A9=C8=DD=A3=
=A1</color></fontfamily></excerpt>=

--Apple-Mail-1--774114367--




More information about the mapserver-users mailing list