Slashdot Mirror


Ask Slashdot: Open Source vs Proprietary GIS Solution?

New submitter rnmartinez writes "As the Project Manager for a non-profit looking to implement a tech project, I am running into a few dilemmas, and as a casual Slashdotter I could really use some help. I'll start with a brief explanation of the project. We research issues in Canadian Immigrants, and found that there was a lack of recent, unaggregated information. As we dug further, we found that some data was available, but there was no central repository. Therefore, we are building a web based service to collect this data, with the intent of having it display in Google Maps and then be downloadable as a CSV file that is readable in GIS software such as ESRI Arcsoft, so that data may be visualized." The dilemma: "...It seems that MS SQL offers more functions with regards to geometry built in then MySQL, and my developers (good guys, but MS guys at heart) want me to switch to .net NUKE/MSSQL and ditch the open source stuff." Read on for further details. "To date, we have relied on a LAMP box with Drupal as the frontend to help provide a more social experience. However, it seems that MS SQL offers more functions with regards to geometry built in then MySQL, and my developers (good guys, but MS guys at heart) want me to switch to .net NUKE/MSSQL and ditch the open source stuff. As a believer in open source and as a non-profit, I am having some moral issues with this (I try and run Linux and open source on everything I reasonably can)."

"So here is my dilemma: do I dump $20K into moving everything to an MS solution that in the short-medium term might make the geometry functions (i.e. show me all the hospitals within a 20km radius of this cluster of immigrants) or do I get him to spend the same amount writing something similar for MySQL? The only issue there, is that I am not too fond of Oracle having ownership of MySQL. Should I be directing $20K into replicating these functions into something like MariaDB? Might be a longshot but again, as a non-profit I'd like to see something go back to everyone, not just my group."

"Really, I am open to any flexible, creative open and reliable solutions. Sorry if my knowledge is limited or if I am grasping at straws, and if I am being terribly biased, but I trust Oracle with open source about as much as I trust MS."

MySQL might fare poorly against MSSQL's geometry support, but how does PostgreGIS stack up?

56 of 316 comments (clear)

  1. Some free resources by techtech · · Score: 5, Informative
  2. Checkout PostGIS by hakioawa · · Score: 5, Insightful

    It is far superior to MySQL geographic types. I'm partial to MSSQL, but PostGIS is a close second.

    1. Re:Checkout PostGIS by jtnix · · Score: 5, Informative

      I was going to recommend PostgreSQL as your DBMS as it has plenty of spatial and geometric data types and corresponding functions, although I have never used PostGIS and can't vouch for it.

      However, if your devs want to use MS tech, I don't think you are in a position to strong-arm them into something they are not comfortable. Not unless you are comfortable with sourcing an entirely new dev team who wants to do it your way.

      --
      She blinded me with science, she tricked me with technology. ~ Thomas Dolby
    2. Re:Checkout PostGIS by hakioawa · · Score: 2, Informative

      Another option is SQL Azure. You get most of the features of on prem SQL Sever, but billed monthly. If you are storing a reatively small amount of data (~10GB or so) it is pretty cheap and get 99.9% up time with littl to no effort.

    3. Re:Checkout PostGIS by Anonymous Coward · · Score: 3, Informative

      PostGIS+PostgreSQL+QuantumGIS

      If you need professional quality maps you'll need to dump your layers to Inkscape via .svg and edit by hand.

      Works for me.

    4. Re:Checkout PostGIS by Dreben · · Score: 5, Informative

      MS SQL does not adhere to the OGC's (Open Geospatial Consortium) Types & Features v. 1.1 specification. If you're serious about storing spatial data in an RDBMS it should adhere to that standard. Highly recommend staying away from SQL Server unless you're willing to invest in ESRI's SDE app server, and with PostgreSQL/PostGIS why even bother?

    5. Re:Checkout PostGIS by KingMotley · · Score: 2
    6. Re:Checkout PostGIS by Dreben · · Score: 2

      According to OGC's list of compliant products, no Microsoft products comply with the Simple Features: Types and Functions v.1.1 specification...
      http://www.opengeospatial.org/resource/products/byspec ...regardless what codeplex says. OGC has a fairly rigorous specifications test.

    7. Re:Checkout PostGIS by KingMotley · · Score: 2

      Actually, SQL 2005 was the first version of SQL Server that supported .NET CLR. It should also run on 2008, 2008R2, and 2012.

      OGC recognizes, it. It is even listed on their website, and no I'm not one of the developers.

  3. Distance calculation is trivial... by JoeMerchant · · Score: 5, Informative

    If you've got something generating Lat/Lon coordinates to slap into your database, the distance calculations are trivial:

    http://en.wikipedia.org/wiki/Haversine_formula

    I didn't see anything in a quick skim of your requirements (tl/dr) that looks like it requires a $20K package to meet. There are a number of open source mapping solutions out there, Google Earth is hard to beat for functionality and ease of programming (see: KML).

    1. Re:Distance calculation is trivial... by Vellmont · · Score: 5, Informative

      This was my first thought as well. Several years ago I did essentially the same thing as the OP is talking about. (Find all the points that meet a criteria within a certain radius of a given point). It took all of an hour or two to research and code.

      If your developers are really complaining about lack of some simple calculations that are built into the Microsoft product, then it's time to either smack these guys hard, or fire them. For something this trivial it should take any good developer a few hours research to find a free solution rather than a paid one. Basically it sounds like these guys aren't willing to expand beyond what they already know, and are far too used to throwing money at problems rather than finding something inexpensive. Non-profits live and die by inexpensive solutions.

      I'd agree with the general sentiment to ditch MySQL, and use a real database like PostgreSQL. MySQL might be OK for trivial websites to store some data here and there, but GIS requires a real database. PostgreSQL is free, works well, is feature rich, and will let you expand. So tell your devs to either adapt to low cost solutions, or leave. If you let them spend 20 grand every time they don't want to do a little work, you'll soon be bankrupt.

      --
      AccountKiller
    2. Re:Distance calculation is trivial... by TerranFury · · Score: 4, Interesting

      ...which raises the question: What is the most efficient way to store points on the sphere for lookup? Computationally? And in terms of storage?

      1.) You can store lat/long, and use the Haversine formula, as you suggested. This requires trig functions, and has O(n) complexity; you need to iterate through all the points. You also have varying resolution over the surface, which makes bounding and early-outs a bit harder.

      2.) A great many other coordinate charts also exist, and it's hard to say why you should choose one over the other without looking in detail at how the distance calculations are performed, etc.

      3.) By using multiple charts -- e.g., a cube projection -- you can avoid issues with singularities, at the cost of branching. The complexity of distance calculations depends on the projection, but, without looking too carefully, my bet is that, in terms just of raw speed, cubemap vs. lat/long is probably a wash.

      4.) Why use a coordinate chart at all, when you can use an embedding? If you store points in 3d, proximity calculations (since the points are on the sphere) just become a dot product. Much faster! It also opens up the possibility of, e.g. (if you will be doing many lookups but few insertions), storing indexes sorted along the three axes (or more!) to speed bounding-box (or more generally, sweep-'n-prune) calculations. Bins, bounding volume hierarchies, and the other standard tricks of computational geometry come into play. On the other hand, you're wasting a lot of codewords on points that don't actually lie on the sphere.

      5.) Is there a more efficient use of codewords? Perhaps a (nearly-)-constant-resolution encoding scheme? If you start with the idea that a node in an octtree can be thought of as an octal number, you can see how you can encode points as real numbers in the interval [0, 1] -- e.g. "octal: .017135270661201") Of course, this still wastes codewords on points not on the sphere, so let's consider a refinement of this idea: At each level of the octree, discard any cube that does not intersect the sphere, and use arithmetic encoding, with the base varying between 8 and 2 depending on the number of cubes that intersect the sphere. This now seems like a (memory)-efficient way to encode points on the sphere -- but it is surely not computationally efficient. On the plus side, this same idea works for any manifold embedded in any Euclidean space, so at least it generalizes.

      6.) Since #5 is a mapping from [0,1] to the sphere, one wonders if there are space-filling curves on the sphere. Of course there are -- e.g., the Hilbert curve in 2d, composed with any inverse coordinate chart. Not that this helps much!

      I think my favorite of these is #5, but, practically, #1 or #4 are probably better choices.

      So how do the real GiS systems do it?

  4. PostgreSQL with PostGIS by binarstu · · Score: 5, Informative

    I would recommend checking out PostGIS, which works with PostgreSQL. PostGIS adds functions, data types, and projection definitions to PostgreSQL that turn PostgreSQL into a powerful spatially-enabled database server. I'ved used this combination for a number of projects, and they work great. Both are fully open sourced.

    1. Re:PostgreSQL with PostGIS by binarstu · · Score: 4, Informative

      I should have mentioned also that I don't know specifically how PostGIS stacks up in comparison to Microsoft's offerings. I can tell you, though, that for the sort of thing you describe (e.g., find out how many objects lie within a given radius of some other object), PostGIS works great.

    2. Re:PostgreSQL with PostGIS by punker · · Score: 2

      +1

      I have used PostGIS and Postgresql extensively for spatial systems. It has rich functionality and can perform very well.

    3. Re:PostgreSQL with PostGIS by Korin43 · · Score: 5, Informative

      This.

      I've used SQL Server and Postgres/PostGIS for spatial queries, and PostGIS is much better. SQL Server's spatial indexes are not as good, and require a lot of work to even be acceptable. PostGIS indexes don't require any work and are faster.

      https://www.google.com/search?q=sql+server+spatial+slow

    4. Re:PostgreSQL with PostGIS by yeltski · · Score: 5, Interesting

      PostGIS and other GIS software probably benefits from OSS collaboration more than other traditional software categories, because they are part of a scientific collaboration. This means there are packages like Mapnik, GeoServer, GeoNode, etc, etc, that are build to work together in an ecosystem. And this ecosystem is larger than any closed system by it's nature. So, nothing can really compete with OSS GIS stack, and especially in the long term, and nothing really is meant to compete with PostGIS, just compliment it in the OSS world :)

    5. Re:PostgreSQL with PostGIS by SplashMyBandit · · Score: 3, Interesting

      Well put.

      Plus, Postgresql has things like "text" columns that work, and can be proper Unicode (not MS SQL-Server's crummy UCS-2, or Unicode haxx blobs where the normal text functions won't work anymore). It also doesn't rape your wallet like Oracle.

      In short, Postgresql does Internationalization right. It is easy for MS Sql-Server to be considered fast, when it doesn't have to do many things properly (like proper UTF or arbitrary length text columns, or spatial indexing, or having source available, or costing nothing :) etc etc).

      Use Postgresql, it will make hot girls like you!

    6. Re:PostgreSQL with PostGIS by ysth · · Score: 2

      You are showing your anti-MySQL bias...real MySQL programmers use char(0) columns all the time.

  5. Why not use a Mixed-Solution. by Anonymous Coward · · Score: 5, Informative

    In my office we work with GIS Data, but a ESRI Desktop license is just too expensive.

    We choose for desktop Manifold GIS and the beauty of that software is that you could use almos any DB Backend to store your geometries. Now we are using MS SQLServer as backend, but Manifold allow you to save everything on WKB or WKT on the database that means that you can use almost any database.

    My suggestion is for the server use a combination of Mapserver+PostGIS.

    For clients you could use Manifold GIS, it's not ArcMap but believe me, with a license of $900 you could do almost the same things that you could do with a ESRI Desktop license of $5000.

  6. there's a lot of FOSS options by jaymz2k4 · · Score: 5, Informative

    Have a look at this post from Sebastian Delmont on google plus. I found an excellent eye-opener to whats out there related to GIS tech that you can "roll on your own". If you are doing simply radial distance calculations than as mentioned the Haversine forumula is your friend. I added a radial search to a dealer locator for an online store in under a day with some python and a bit of time to geocode and cache all the address data via google.

    --
    jaymz
  7. PostGIS by SSpade · · Score: 5, Informative

    http://postgis.refractions.net/ - pretty good spatial functions based on top of PostgreSQL, and not tied to Oracle.

    There are many, many open source GIS packages that you might find useful rather than implementing everything yourself. http://maptools.org/ is one place to get some pointers from.

  8. PostGIS and OSGeo.org by daboochmeister · · Score: 5, Informative

    Run, do not walk, to research the Open Source Geospatial Foundation's offerings. And be aware, neo-geos devote their efforts primarily to PostGIS, which builds on the very capable PostreSQL database, adding in geospatial capabilities that by many accounts rival the best that that Oracle Spatial and MS SQL provide.

    As always, there are significant tradeoffs to evaluate in your situation. Be ready to study the many evaluations and comparisons of the various solutions.

    --
    "Ahh! I see you're in that indeterminate Schrodinger state where - oh, uh ... never mind." Dave Bucci
  9. PostgreSQL + PostGIS by sgtstein · · Score: 5, Informative

    At my place of employment we use PostgreSQL and PostGIS extensively for the exact or similar problems as you describe. We recently contributed back to a portion of the PostGIS project by extending the TSP solver for a different ending than the beginning. I'm not the one who is generally writing stuff like this, but I maintain the servers and I know how much performance can be gained. Plus, the PgSQL and PostGIS guys are very close with lots of code and advancements being contributed directly into PgSQL from the PostGIS team. We have also looked at the MS solutions and found them to be ridiculously expensive to host and scale services targeted at business with real-life budgets and not huge corporations. We have tools used in nearly all of the counties in Wisconsin processing many requests per day and second(not allowed to give numbers) with only a few servers. Personally, stay open source and stick with PostgreSQL. They have a track record for extremely stable systems that can be upgraded as advancements are made with very little downtime. You can tune the internal performance metrics to tweak everything you need with online research or many books and even consultants such as EnterpriseDB. Good Luck with your developers, go with PostgreSQL and you won't look back.

  10. MySQL and Drupal are fine by topham · · Score: 4, Interesting

    I can safely say that MySQL handles GIS data sufficiently for the type of scenario you've described on Slashdot. I've got a database I periodically play with that is all the cities / major towns of the world and can quickly query it with distance data. (as in: Give me everything within 100 miles of Lat,Long)

    MySQL doesn't make all of it as easy as it should be, but with some careful design decisions it can work surprisingly well for it.
    I previously had created a distance function that worked pretty good, but more recent versions of MySQL have better internal support and I was able to ditch some of my custom routines.
    (Note: my routines performed efficiently, but gathered extraneous data that could later be filtered out to be more precise. The extra data was maybe 10% more than necessary, but meant the query was very fast.)

    Perhaps you should be looking to upgrade your MySQL instance, or getting some procedures/functions written for MySQL to handle some of the calculations.
    (It's pretty easy to calculate a rectangle for the query to run against, and then follow up with a more precise distance calculation to filter out a few stranglers that slip into the dataset. (better to include a few that are dropped in later stages than to exclude valid data up front)).

    As for the moral issues: Stuff them. They aren't what you should be focusing on.

  11. Only one true FOSS option: PostgreSQL + PostGIS by Anonymous Coward · · Score: 5, Informative

    Disclaimer: I work for Esri.

    In the FOSS GIS world the go to DBMS is PostgreSQL + the PostGIS extensions. Don't even consider MySQL in this regard. PostGIS owns this space and rightfully so.

    SQL Server is a great database as well and their spatial types and functions are excellent. Depending on how much data you'll be storing and processing - and if you have Windows Server licenses already - you may be able to use SQL Server Express which is free as in beer for any use.

    For someone in your position though there's really only one choice: go with PostgreSQL + PostGIS. It would be silly for someone in your position to pay for this functionality and the PostGIS community would welcome you with open arms.

  12. Work out what you need first. by jdaragon · · Score: 2

    This is an excellent question. Do you need to perform arbitrarily complex operations on geometries, or are you looking for very simple geospatial operations? If, for example, you need to find all points within a complex polygon, or calculate overlaps then it's likely to be useful either to buy into a real GIS system, or investigate something like the GDAL OGR library. If, however, all you want to do is the sort of thing you describe, you can probably get away with calculating a bounding rectangle from the set of points you have and extending that in each direction by an arbitrary amount. Lo - store grid references or Lat/Long, and you need no geospatial support in your database at all. If you *did* need geospatial support, and were persuaded that MS-SQL were the way to go, then check if you qualify for WebSiteSpark in Canada - that will get rid of most of the 20k you need to spend and get you Server 2008, SQL Sever 2008, Visual Studio 2010 &c for $100 over 3 years. How much data do you have? SQL Server 2008 Express has the spatial extensions.

  13. Re:Obvious answer by fuzzytv · · Score: 2

    There's a saying about stupid questions and answers, but never mind ... Your answer is based on several assumptions:

    You're right that custom code is usually more expensive than already available boxed solutions, under the assumption that the generic solution implements only the needed code and does not need to be modified. If the generic solution implements much wider range of functionality than you actually need, the custom code may be actually much cheaper. And if you need/want to change the internals, it's going to be very expensive (outweighing the prior savings) or even impossible. Plus you usually have zero influence on future of the product.

    I really don't see how the choice of MSSQL (or any other database) eliminates the need for proper testing ...

  14. Re:MS SQL is better by Grishnakh · · Score: 2, Interesting

    I say pay whatever it takes to switch everything to MS-only technologies, since your developers prefer that. Then, to make the budget work out, cut all their paychecks by that same amount. (Actually, you should cut their paychecks by quite a bit more, since you have to account for the continual license fees needed, and the fact that some of them may quit.)

    Or offer them the choice between this and doing something lower cost that works as well and doesn't require continual license fees.

  15. Re:Obvious answer by tragedy · · Score: 2

    Sounds reasonable until you consider that both approaches are going to require custom work. Even though the whole point of languages like SQL is that you're supposed to be able to swap out the back end easily, in the real world, you have to do all kinds of work. So the choice isn't between some kinds of simple switchover or doing a lot of custom work, it's between doing a bunch of custom work or doing a different bunch of custom work. Oh, and the third option of finding a prepackaged solution that does what you want without swapping out such a major part of your application stack.

  16. GIS improvements already are in MariaDB by Lordrashmi · · Score: 4, Interesting

    Disclaimer: I work for Monty Program Ab, the primary developers behind MariaDB.

    MariaDB 5.3.3 (currently in RC status) has improved GIS functionality versus MySQL. While sponsoring new features could improve it even further what we are releasing right now might be enough for you. Please give it a try, and talk to us about how we could make it fit your needs better.

    1. Re:GIS improvements already are in MariaDB by ysth · · Score: 2

      Those not familiar with Monty Program's business model can read about it here:
      http://montyprogram.com/hacking-business-model/

      If the missing features are not already in MariaDB, it certainly provides a nice opportunity to take that $20K and use it to benefit everyone.

      (Though the OP doesn't identify the missing features, so it's not clear to me that they even exist. In his/her place, I'd be thinking about replacing the reluctant devs, not the target platform.)

  17. The Obvious answer by Joe+U · · Score: 4, Insightful

    And why didn't you provide an answer to the submitter, rather than troll?

    Oh! Oh! I have an answer. Pick me!

    It's because you're trolling just as hard!

    You spent 5 of 6 lines attacking the person who wrote the post, 1 line talking about some other topic and zero arguing the merits of the post.

    Yay! I solved the puzzle. I'll take the cupcake for $10 and the rest on a gift certificate Pat.

    I personally agree with the OP, you use the best tool for the job. If you are designing your own tools just to save money, then you're under-valuing your time as a developer. If in this case MSSQL works, then use it, if in another case MySQL works, use it.

    1. Re:The Obvious answer by EdIII · · Score: 4, Insightful

      I personally agree with the OP, you use the best tool for the job. If you are designing your own tools just to save money, then you're under-valuing your time as a developer. If in this case MSSQL works, then use it, if in another case MySQL works, use it.

      The OP does not know what they are talking about, and their point about the database and bug testing is inane. It's a vast oversimplification of the problem.

      Code development is going to happen one way or another here. Saying custom code costs hundreds of times a proprietary boxed solution is an incredible generalization, indicates that they have not even read or considered the problem, and have thus been simplistic and given rash counsel.

      The question at hand is one of platform.

      Do you develop on a proprietary database platform with non-trivial licensing costs to gain certain features and decide to use a coding platform that also has non-trivial costs in the form of tool sets, etc.?

      Or...

      Do you develop on an open source platform, that is finally maturing to a point it might be considered seriously for enterprise use (MySQL), and choose a coding platform that is also open source with quite possibly cheaper tools?

      There are many things to consider here. Time To Market. That's a big one. If you need to bring the solution online and in production within 90 days, and it is not possible with the budget and personnel to do it yourself, than you really should consider a "boxed" solution. Some of those are even built on open source platforms as well.

      Generally, doing it yourself will not cost hundreds of times more. That really varies. If you have the time and manpower to build a project yourself, and possibly open source it, you could easily do it. The cost of maintaining it though means that you will need to keep some developers on staff. With this particular situation that does not sound like an issue. They are not reinventing the wheel here. Ongoing support is going to be required no matter what.

      In this particular instance it seems it is the choice between MS and open source. This guy just has to evaluate what his true costs really are. How much over the expected life time of the service will MS licensing cost? How much will MS experienced coders (both MSSQL and .NET) cost to keep on staff versus open source coders? If he had to modify MySQL to gain some features of MSSQL how much will that cost him over the long haul?

      Choosing MSSQL does not mean you are locked into .NET either.

      You're right about your time as a developer and choosing the best tool for the job, but there are many other important considerations too. The OP was being vastly simplistic.

      Personally, I would need an extremely good reason to choose anything that requires MSSQL. That is not a trivial cost. It, in fact, has "dependency" licensing costs that are non-trivial as well. If you really need enterprise features and your project and production environment absolutely must have it, then that's that. Pay the money, budget for it, and get cracking.

      That is what I really think his concern is. Going MS means a commitment, and a serious financial commitment at that. Are those features really really worth the tens of thousands of dollars per year MS is going to cost?

      Open source not only allows code changes, but the licensing costs are zilch. You could buy support contracts, but otherwise, hardware costs are pretty much a wash.

    2. Re:The Obvious answer by JoeMerchant · · Score: 3, Insightful

      If you are designing your own tools just to save money, then you're under-valuing your time as a developer.

      This statement has to be qualified by comparison to the cost of the tools.

      If the (additional) tools required take less than one man-month to develop as compared to the purchased package, well, I'd like to be worth $20K/month, but I'm not. Also, the initial purchase price is often the camel's nose under the tent flap, any organization I have ever been in would spend at least $10K of management handwringing, accounting, comparison shopping, independent consultant referencing and other time to decide if and when to pull the trigger on a $20K purchase. (Not true, one place I worked had a $25K/quarter discretionary budget at the department level, keep it under that and you just had to convince your Director - does your shop have $25K/quarter quick access discretionary money left in the current budget?) Back to the stinking camel - now that you've paid $20K for it, what are the "hidden costs" of maintenance and upgrades for the package?

      Most times, it's less effort on my part to code the algorithm in question than it is to pull the levers required to shake loose more than $1000 from the money tree - so, am I serving my organization better by using my time and skills as a programmer, or as a lobbyist convincing them to spend money?

  18. PostGIS (app server for PostgreSQL) by Dreben · · Score: 2

    I've been doing geospatial development since 1992 when Genasys (defunct) released the worlds first web mapping server, Web Broker (ESRI's IMS wasn't released until 5 years later). At the time the only COTS option for managing spatial data within an RDBMS was Sybase's Spatial Query Server, which provided slightly more geometry options inherent within MySQL today. MySQL geometry features should be considered primitive at best, far from a full-featured implementation. On the other hand, PostGIS, is full featured and the only open source implementation I know of that adheres to the Open Geospatial Consortium's 'Simple Features: Types and Functions 1.1' specification. It is very robust, scales well (in contrast to MS SQL) and you can't beat the price or ease-of-mind that comes with being licensed under v.2 of the GPL. Additionally, on comparable hardware, in terms of reliability, performance, and cost effectiveness, there is no comparison, regardless whether your using Oracle w/Spatial or MS SQL and ESRI's SDE.

    Your developers, as good of guys at heart as they may be, should stay away from the kool aid for awhile

  19. GIS Stackexchange by spandex_panda · · Score: 2

    Firstly, you can post questions here: http://gis.stackexchange.com/ and they will be answered. It seems to be a pretty good community, I have been posting on there for a little while.

    Secondly, I don't use databases a lot, but I recommend that you do what you suggest. Make a Google Map and make a CSV for folks to download.

    --
    like phosphorescent desert buttons singing one familiar song
  20. A bit sad. by tragedy · · Score: 4, Insightful

    Am I the only one who finds it a bit sad that this is considered a hard problem to solve in house? It depends on how you have your database set up, but, you could store your latitude and longitude in different fields as degrees, minutes, and seconds (do you need resolution finer than about 30 meters?, then add more fields, need coarser resolution, do the same). Then, you start at your center point and draw an appropriately sized circle (more on that after) around that point using an algorithm that gives you all the second^2, minute^2, and degree^2 (and larger and or smaller blocks as precision requires) sized blocks that fall inside or touch the circle. Then you craft a select statement for all sites that match that set of blocks. Then, after you have that set, if you don't care too, too much about precision, you're done. If you do, you take the data set that's been returned and you look at all of the sites whose block intercepts the circumference and calculate their distance to the center and throw out the ones that are too far away. If you're using a flat earth (not flat as in pancake, flat as in a perfect ellipsoid) model, then you're done at this point. If you want to consider three dimensional distances on an earth with mountains and valleys, etc. (the "appropriately sized circle" mentioned above should already be taking care of the perfect ellipsoid model), so that a site 100 meters away horizontally but at the bottom of a 1.5 km cliff isn't considered to be 100 meters away, then you need to do more work and you need the altitude of each site in your database as well. Since you can pretty much rely on a fairly low maximum amount of overhang from cliffs and so forth, all you need to do is have an inner circle and an outer "appropriately sized circle" based on some precalculated constants regarding maximum changes in altitude over the whole earth calculated by coordinate block of some given size (computing or obtaining those constants is the trickiest part, put it's not hard, it just requires the appropriate GIS data and some number crunching) and stored in a table. When you compute your inner and outer circles, you just take the local terrain into account and draw the outer circle as far out as any sites in those blocks could possibly be from the center, and the inner circle as far in as they could possibly be. Then you work the blocks from the outside of the max circle to the inside of the min circle (not bothering to search blocks bounded on the outside by other blocks where you've already determined all the sites are inside your max area).

    For calculating the "appropriately sized circle" in the first place, you make use of the Haversine Formula or an appropriately modified (for altitudes) version thereof and some safe margin around the edge. Voila. Now, I know I've fudged past some of the math here, especially for the more complicated cases, but this is still pretty simple stuff, especially for the simpler cases. This is CS Major Sophmore or Junior year stuff.

  21. Re:MS SQL is better by ShnowDoggie · · Score: 3, Insightful

    What if they actually save money by being more productive?

  22. Re:MS SQL is better by jellomizer · · Score: 2

    Umm there is a cost to retrain your developrs to use new tools. If the developers like .net it is probably worth a few K to give them the tools to do what they need. .NET doesn't suck neither does MS SQL (Microsoft has upped its game in product quality the last few years). The time and cost of finding an appropriate Open Source tool and get your coders up to speed will more often then not be more expensive then using the first decent solution that is available and liked by your staff.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  23. Re:Obvious answer by _Sharp'r_ · · Score: 4, Insightful

    This may be too obvious to be helpful, but since the submitter mentioned that they use Drupal on top of their database, why not just use one of the Drupal Google Maps modules as a starting point?

    Google Maps Tools provides the very proximity function he's looking for (among other things) and there are many other easy integrations with Google Maps he can use as well.

    That said, if he really wants to do the calculations at the DB layer, then switch the installation to Postgres GIS as mentioned elsewhere.

    --
    The party of stupid and the party of evil get together and do something both stupid and evil, then call it bipartisan.
  24. My $0.02 on GIS tools by Bob+the+Super+Hamste · · Score: 2

    I have had a fair amount of success using open source GIS tools for one of my side project to create a hunting map book. I am not too sure of how well either one would work for what you are trying to do but I would be surprised if they didn't. The 2 tools I have had the most success with are uDig GIS and GRASS GIS. Both of them will run on Window, Mac OS, or Linux just fine, they all can process shape files, and DB input as well as geo tiff files as well as other file formats. Another popular OS GIS program is Quantum GIS. When I started I found OSGeo4w which had a bunch of open source GIS programs compiled for windows with everything you need and tried out a few of them and found 2 that best suited my needs. At the time I know it included GRASS, uDig, QGIS, and a couple of other ones, you might want to check out OSGeo as well as there may have been other projects that have started or better meet your needs.

    Here is an example of some of what I have done. It is a map of the MN deer areas showing the antlerless deer harvest per square mile for each area in relation to all the others during the archery season. This map is a 10 year snapshot where the darker area indicated more deer were taken per square mile.

    --
    Time to offend someone
  25. You are not the only one. by Skapare · · Score: 2

    How effing accurate does such a thing even need to be in a social networking context? Still, it wouldn't be hard to get this down to sub-meter accuracy. It could be hired out if need be on one of those programming task sites for under $1000 (far less that the $20000 initial outlay to put up a decent couple of machines to do it in an MS-SQL way).

    I suspect there's a band of "we are scared of maths" programmers somewhere near the OP.

    --
    now we need to go OSS in diesel cars
  26. Yet another Canadian immigration scam ... by tomhudson · · Score: 5, Informative

    Canada is finally cracking down on fake immigrants. One of the biggest problems is the abuse of the immigrant investor program which this business apparently is trying to exploit, if you actually look at their web site:

    About Rodolfo Martinez

    I am the Executive Director of Ontario Immigrant Network, and currently we are working to connect newcomers to rural business succession opportunities.

    In other words, "buy your way into the country by buying some dead persons' business."

    Nice scam - too bad Mr. Martinez isn't licensed. The Canadian government has required licensing of anyone doing immigration consulting since 2004 because of the number of scams and abuses.

    As of April 2004, the only immigration and citizenship consultants who will be recognized by the federal government department of Citizenship and Immigration Canada are those who are members in good standing of CSIC or lawyers who are members of a Canadian provincial or territorial law society.

    1. Re:Yet another Canadian immigration scam ... by rnmartinez · · Score: 5, Informative

      Hi Tom, just a bit about our group. We don't run any immigraton scams, and certainly aren't looking to have people buy dead people's businesses. We don't even deal directly with immigrants (i.e. we are not immigration consultants). Our focus is to work with rural communities that have ageing demographics and help them attract immigrants to take over businesses where an ageing owner is looking to retire but may have no clear successor. Our ideal immigrant is one that has already been in the country for a period of about 2 years. Essentially, we are trying to stop smaller communities from suffering mass business closure, and this technology piece will play a large part. I hope that this helps to clarify.

    2. Re:Yet another Canadian immigration scam ... by tomhudson · · Score: 5, Informative

      First, a quick peek at your web sites over the last 6 years:

      Finally, an online networking service that connects you with influential people who can reshape your career, business, and personal life

      Immigrant networking
      Talk to your peers
      Find inside jobs
      Make new friends
      Solve your problems
      Best schools to go for
      Finding a good doctor
      What car to buy
      How to buy a house
      And much moreâ¦

      It's a one-letter-off typo squat of immigrantnetworks.ca - cheesy or sleazy, take your pick. Your domain has a history of trying to find some way to intermediate into the whole immigration thing.

      Now, when you say. "Our focus is to work with rural communities that have ageing (sic) demographics and help them attract immigrants to take over businesses where an ageing (sic) owner is looking to retire but may have no clear successor", that is a problem.

      First, such activities have been regulated by federal order since 2011. Neither you nor anyone else can offer to help immigrants with such things as where to locate, or business opportunities, either directly or indirectly, without being licensed.

      Second, if there is "no clear successor", then the property or business cannot be sold until probate, and no amount of GIS data can "fix" that problem.

      Third, if the problem is that nobody wants to buy a business at a certain price, they can always lower the price. At the right price, everything sells. If it doesn't sell at any price, it's not viable. Conning an immigrant into buying a dying business only works if their real goal is to show that they are establishing roots - it does nothing to stop the "brain drain" - people leaving because they lack opportunities. In fact, it exacerbates the problem because the next generation has to compete against "false bidders" - bidders who are really buying a "ticket to permanent Canadian residency" to buy the local business. In other words - you would be, at best, part of the problem, not the solution.

      Fourth, trying to hook up immigrants to buy such businesses, which "coincidentally" help to show that they have established roots, is a regulated practice, and I already checked - you are not licensed.

      Fifth, I also noted that you put your name as an image, instead of plain text, to avoid being picked up by search engines. Inquiring minds would wonder about that ... but after looking at the thin gruel you have to offer, I'm not all that surprised.

      Sixth, nobody needs GIS data to do this - and trying to sell such a concept, either to communities or to immigrants, is akin to "Search Engine Optimization" scams - anyone can find such properties / opportunities with 10 minutes work on Google. What next - "Oh, pretty graphs?" Oh, wait, your terrible (as in first year high school) "white paper" already does that. Yes, I read it, and it really sucks.

      Seventh (yes, I'm on a roll) your original question showed that neither you nor whoever you're working with have much of a clue about databases. You don't need ANY "geometry functions" to do what you are trying to do.

      I could go on ... but I think I've made my point, which is that your business activities raise red flags, and the the whole precept on which you claim to operate (to "stop the brain drain") is flawed and will have the exact opposite effect. Cui bono? ... or more to the point - "what's in it for you?"

    3. Re:Yet another Canadian immigration scam ... by Anonymous Coward · · Score: 3, Insightful

      First, such activities have been regulated by federal order since 2011. Neither you nor anyone else can offer to help immigrants with such things as where to locate, or business opportunities, either directly or indirectly, without being licensed.

      which says more about the right wing jingoistic xenophobic jerks which are currently running the Canadian government than anything else.

      thought experiment: extend "immigrants" back to anyone who is not first nations. making it illegal to help people in need... geez, has it gone from terry fox to this in just 30 short years? completely and utterly disgusting behaviour.

      I reckon this fellow has both a responsibility and a moral obligation to help his fellow immigrants, immoral laws should be broken at every opportunity. (in a moral and responsible way of course, I've no idea about his particular business practices)

      since 2011? so it's at least 2 weeks old?

      why all the hate?

    4. Re:Yet another Canadian immigration scam ... by DarwinSurvivor · · Score: 2

      Those laws are to PROTECT immagrants. They protect them from people just like the people we are discussing who convince immagrants to go into deals that they don't understand so they can become "citizens". What happens later is that they eventually discover how screwed they got in the deal, lose the business and end up just as stuck as they were to start with, minus quite a bit of money. If his "non profit" what-ever is truly legit, why not simply get licensed?!?

    5. Re:Yet another Canadian immigration scam ... by rnmartinez · · Score: 3, Informative

      Hi Tom, I appreciate your concerns, and I hope I can address them here. It sounds like you may be in the US (the poster below is right, "ageing" is correct spelling in Canada) so I will point out a few differences as well. Our group came into existence in 2009 and that is when we took our domain. I don't know what it was used for previous to that, but obviously it was some type of spam. In terms of being one letter off of another group, I admit, we probably didn't research it enough but we were a non-profit starting up on a volunteer basis. It fits our name, and we have also added oinweb.ca for URL shortening and to help alleviate confusion. Yes, there is federal regulation surrounding these activities, however we do not work directly or offer any services to any immigrants or individuals. We are not involved in the settlement process, and we are not involved in any business transactions. The bulk of what we do is research, and from there come recommendations that communities are welcome to take or not. These licensing requirements do not apply to us, and I doubt that we would even be allowed to become licensed because of the nature of our work. We simply do not have any contact with any legal or business transactions. Second, business succession may have a different meaning in the US. In Canada, the process is meant to take place while the entrepreneur is alive. Were we dealing with estates, then yes, you would be correct. This example may help to clarify: Imagine that you were a successful business owner for 20+ years, but because of skewed demographics the bulk of your towns population is too old or too young to buy it. If you do have kids, they have likely left for a larger city like Toronto. This means that a profitable business, that could be a great opportunity for an immigrant could disappear, and potentially even trigger a domino effect (i.e. more businesses closing). We have seen this in some communities, particularly those hit by the decline in the auto industry. This doesn't mean that the towns are dying or dead, but it certainly can make things challenging. The GIS data portion doesn't relate to this, but certainly helps us in research. Canadian census data is not as rich, un-aggregated or recent as US census data appears to be (although my experience with US data is highly limited; I know that in Canada we used to have one long form census every 5 years that was recently abolished by our government). Also, until recently, this data was highly expensive. To obtain 2006 data for Ontario used to cost approximately $6000, which is quite a bit of money for a non-profit. While GIS does not solve or replace this, it is a great analytical tool. Third, I agree completely, that businesses will only sell for that they are worth. The issue is not value, but rather a highly skewed demographic. And again, our intended audience are those already in Canada, the majority would already have a legal status or be well on their way to obtaining it. Without at least permanent residency, I imagine that just buying the business itself would be incredibly difficult, as I can't think of a bank that would finance the deal. In terms of brain drain, we are not looking to stop, but rather bring new people in. I can't stop youth exodus, but I can try to promote rural regions as opportunities. There aren't really false bidders, but rather no bidders. Fourth, again, we do not offer any services directly, are not funded to do so, and do not receive any type of cut from any transactions. We are not realtors, lawyers or anything similar, simply researchers offering our ideas to interested communities. Fifth, I am not sure if you mean my name personally or my groups. This is a product of our website. If you can clarify, I can certainly look into it. Sixth, as researchers, we can choose what tools we want to use, period. You cannot decide what we do and do not need. And many communities already use GIS, but not in this fashion. Currently, we are not charging any of them for our work, so I don't see the harm in visualizing

    6. Re:Yet another Canadian immigration scam ... by rnmartinez · · Score: 2

      We aren't breaking any laws immoral or otherwise, if you see my post above (not sure why line breaks wouldn't show up, sorry for the verbal mess) we don't offer any services directly to immigrants or are involved in any business transactions, but I do agree that we could do more for immigrants.

    7. Re:Yet another Canadian immigration scam ... by rnmartinez · · Score: 2

      Hi, we don't actually deal with the transactions, we are largely research based. If we did move to offering services, then of course we would become licensed.

  27. Re:Lower costs? by Grishnakh · · Score: 2

    The problem, as I see it, is that the original poster is comparing the wrong things; namely, he's looking at MySQL for some odd reason, when several other people have here already pointed out that the de-facto OSS solution to this is PostgreSQL and PostGIS. Sounds pretty much like a drop-in solution to me.

  28. Re:Consider remedial training for your staff by Bert64 · · Score: 2

    He makes good points...
    If you lack technical skills then buying pre packaged software is for you, but you certainly shouldn't go around tricking people with even less technical skills into thinking that you're somehow an expert.
    If however you are technically competent, then it is almost always better to have software that you can modify to suit your needs, and which you can understand inside out.

    Similarly if you're a competent and well taught developer you should have little problem adapting to different platforms, and you should actually *want* to because experience of more platforms increases your value as a developer.

    There is a reason why the companies with the most inhouse technical skill build their core services on open source (Think google, yahoo etc). While your typical non tech company simply buys in commercial software (and often get ripped off by overpriced low skill blag-artist consultants).

    --
    http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  29. Re:MS SQL is better by godefroi · · Score: 3, Insightful

    If you ignore them, and you admit you're ignorant when it comes to them, why are you commenting on them, and providing advice regarding them? Maybe you'd be better off providing advice regarding platforms you're knowledgeable about?

    --
    Karma: Poor (Mostly affected by lame karma-joke sigs)
  30. Re:Unprofessionalism at its finest by Jason+Earl · · Score: 2

    Both solutions are going to require custom programming. One of them chucks the existing (mostly working) solution, the other builds on the solution. That is a fairly substantial difference.

    Heck, I could understand if the developers wanted to simply chuck MySQL and replace it with MS SQL Server (which apparently also works with Drupal). I personally would probably use the existing Drupal solution with PostgreSQL, but if the developers feel more comfortable with MS SQL Server I could see that being considered.

    However, the developers aren't talking about moving to SQL Server to get them the database functions they need. They are talking about throwing away the existing solution completely and rewriting in DotNetNuke and MS SQL Server. That's just plain crazy unless the existing solution is worse than nothing at all, and the developers on staff have a spotless track record for delivering on time and under budget.