Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: New to forum - Using SVG maps generated by php from data in mysql

  1. #1

    Default New to forum - Using SVG maps generated by php from data in mysql

    Hi All,

    I am based in London UK and am working on a map of Roman Britain. It is in fact a game so the map changes over time. It is also interactive with some JavaScript but mostly via hyper-links.

    It is a vehicle for me to learn how to write an application which can be used across any compliant device which can process SVG. SVG is also used for symbolism and iconography to vacillate the reduction of text.

    I would be interested in anybody else doing the same - its been a lonely year so far.

    I find that the cartography not only very great fun to work on but the community seems the most advanced for what I want to achieve.

    At the moment I hand code all my SVG usually via php, for example roads, population centres where the data is stored in a MySQL database.

    Anyway, just thought I'd drop a line to introduce myself.

    Simon

    The title should be Data in MySQL not date but cannot edit it
    Last edited by Simon Tomlin; 09-14-2011 at 07:49 AM. Reason: misspelling in title

  2. #2

  3. #3

    Default

    Thanks for changing the title.

    I had to google GIS application, so I am behind in the cartographers worlds lexicon. However reading the Wikipedia entry and what I am doing is similar, albeit on a more modest scale.

    At the moment I am using a OS map but it was hard work getting the data into the database and was wondering if anybody else had tried the same thing. I could use satellite maps I guess since its the topography I am interested in.

    I have only just signed up and will trawl the posts as I am sure to find some golden nuggets of information here.

  4. #4
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,193
    Blog Entries
    8

    Default

    I think the responses depend on whether you are after the map or after the knowledge about how to make the map using the PHP, MySQL and SVG. As Rob has said your writing a GIS app and there are loads of them about, some big and expensive like say ArcGIS and others free and open source - QGis I think is a free one.

    Isomage here had some maps which were done from some scripts and generated SVG. I know Inkscape will export SVG vector data if you want to look at any or check compatibilities at any stage. I know that some browsers like Firefox will display SVG directly so its a case of writing out some text files and sending to the browser. I.e. doing a web page SVG map is not a big deal. Getting the right SVG from the data is where the effort is of course.

    Anyway, look forward to seeing what you come up with.

  5. #5
    Community Leader Facebook Connected Steel General's Avatar
    Join Date
    Jun 2008
    Location
    Ft. Wayne, IN
    Posts
    9,530

    Default

    Welcome Aboard!
    My Finished Maps | My Challenge Maps | Still poking around occasionally...

    Unless otherwise stated by me in the post, all work is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.



  6. #6

    Default

    I have the knowledge of PHP, MySQL and SVG. perhaps if I explain where I am and the problems I have or foresee.
    I have a map of Southern Britain which is taken from an OS Map of Roman Britain.

    I am actually interested in the period 350BC but it does not matter really. The map is at the scale of 100m, so below that is not represented. I have 10 tribes in this area which do varied economic activities such as wood cutting, trail building, building stone circles and also having military units. These activities impact the environment which is recorded by the database which is then used by php scripts to create the SVG which is then sent to the browser. Military armies can also move over the map using the roads/trails for efficiency. All this is in turn based real time which at the moment is set at 8 mins equals one day so a year is approx 48 hrs in real time. Each one of the tribes can be either human controlled or by the AI. Combat is carried out by taking the map data and expending it by a factor of 100 to give the dimensions of 1 metre per user unit. This new map it created purely to record the battle and its results. The actual logic for this is in PHP which then creates the SVG so that the battle is displayed via animation so a player can view the battle. Some browsers have the ability to pause and VCR like control the animation but most just play it through.

    This all works fine except the graphics are poor due to my lack of artistic talent and also I have to code all the graphics which means they have to be somewhat minimal however the main issue is keeping the transmission size down since I want it to be usable on small devices such as mobile phones where data traffic can be costly for the user.

    The problem I have is it needs to expand to cover the rest of Britain and Wales plus Gaul and ultimately the entire area at the height of the Roman empire. Hand coding from OS maps is not the answer so I need to find a better method and cartographers are the obvious folks who have this expertise. I think I have learnt something useful already with the GIS app information that has been provided. I really have no intention of trying to replicate something already in place. I will take a look at QGis.

    I have used Inkscape and although very good for detailed drawings it is of limited use due to its large file size. I have to go back and edit all the files anyway so I find it easier to hand draw what I want and then code it.

    Another issue I have which has not been resolved was displaying the forestation of the landscape. In the beginning I would paint the trees on the map according to a formula which worked well except the file size was too much. I tried using patterns but I need them to be placed in specific areas or they can clash with over features. I then tried simple colouration which would display the level of forestation by shades of green. This was a horrible failure as it was just plain ugly.

    I am currently rewriting a version for single players which will be the tutorial. I will post the link but its not mapping to any advanced level. It would only be of interest to someone who wanted to use some of the technology.

    Anyway thank you for the tips and I'll post some maps - maybe when the game is at the later stages and the maps have some data on them. Although the quality on here is at a much higher artistic quality than a coder like myself can create.

    Let me have a look around and find the correct group to post in.

    Thanks again for the reply
    Simon T

  7. #7

  8. #8

    Default

    Hi again, Simon. Also wanted to point you to: http://dev.mysql.com/doc/refman/5.0/...xtensions.html just in case you weren't aware of them. I think the GIS extension is fairly new to MySQL as a few years back I was forced to use postgres to get that functionality.

    -Rob A>

  9. #9

    Default

    Hi I actually posted a reply to Redrobes but for some reason it said waiting for a moderator to approve?

    The GIS extensions are totally new to me and I am grateful for the link.

    I'll have a look at them and keep you posted. Could be a massive bonus for me. Thanks

    Simon T

  10. #10

    Default

    Quote Originally Posted by Simon Tomlin View Post
    Hi I actually posted a reply to Redrobes but for some reason it said waiting for a moderator to approve?

    The GIS extensions are totally new to me and I am grateful for the link.

    I'll have a look at them and keep you posted. Could be a massive bonus for me. Thanks

    Simon T
    I approved the post. The auto-mod caught it in the queue.

    -Rob A>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •