Pregunta

I'm developing a Rails app (3.2.8) that will use the activerecord-postgis-adapter and activerecord-spatialite-adapater gems and various rgeo plugins.

I would like to use the Rails unit and functional tests in the traditional way, but this sort of testing is usually done with random or garbage data. Factories and fixtures are obviously no help beyond the very simplest polygons and arrangements.

This question provides links to freely available shapefiles, but seeding the test DB with well-understood, high-quality data does not seem like the best idea. For example, the edge case where a region only partially contains a polygon will be missed if I use US states and counties as my test data.

What is the best way to test this app? Is there a factory for GIS DB's for Rails? Is there something like Faker for using random data?

¿Fue útil?

Solución

I am working on a similar GIS database. I am not aware of a Faker like gem for testing geographical data. I believe the best approach would be to create the seed / test data yourself. The approach I took was to use machinist to created blueprints with data that I created and use that for the tests.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top