Permalink
Commits on Jul 14, 2016
  1. Better error handling for invalid GeoJSON geometries

    vmx committed with hsharsha Jul 12, 2016
    When a GeoJSON geometry with an invalid type is emitted, there
    wasn't a proper error response, but just an empty reply. With this
    change you'll get this error message:
    
        {"error":"emit_key","reason":"The supplied geometry type `point` is not a valid GeoJSON. Valid geometry types are (case sensitive): Point, LineString, Polygon, MultiPoint, MultiLineString, MultiLineString"}
    
    Change-Id: Ic8beec2a4394f5c7006668ce81a1cbb7161ae6c0
    Reviewed-on: http://review.couchbase.org/65674
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Commits on Jun 27, 2016
  1. Update README

    vmx committed with vmx Jun 22, 2016
    This master branch now also works with Apache CouchDB 1.6.x.
    
    Change-Id: I031d7584fd409f65b5cd0644bc6185d105d545ef
    Reviewed-on: http://review.couchbase.org/65182
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
  2. MB-19996: Fix bbox support

    vmx committed with vmx Jun 22, 2016
    It is possible to supply a bounding box as part of the geometry:
    
        {
            "type": "LineString",
            "coordinates": [[200.0, 0.0], [201.0, 2.0]],
            "bbox: [200.0, 0.0, 201.0, 2.0]
        }
    
    This bounding box will be used instead of calculating it based on the
    geometry. Prior to this commit, it lead to an error when a bounding
    box was supplied.
    
    Change-Id: I940fbfade1f6d737c50dda2a58f7ea39571017ca
    Reviewed-on: http://review.couchbase.org/65181
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
Commits on Jun 11, 2016
  1. Update README

    vmx committed Jun 11, 2016
    The README was outdated. It also didn't contain as much information as in
    previous versions.
    
    Change-Id: Ia752d0231b985651472c44215775fb732895da54
Commits on Jun 10, 2016
  1. Extract bounding box correctly

    vmx committed Jun 10, 2016
    If a GeoJSON geometry has a bounding box defined, it wasn't processed
    correctly.
    
    Change-Id: I811819227cc98c9378d36cc9b1037863ab5b62a4
  2. Remove plane_bounds query parameter

    vmx committed Jun 10, 2016
    The `plane_bounds` query parameter was a bad idea and it also doesn't
    make much sense in the multidimensional context. Hence it's removed.
    
    Change-Id: Ib8942264efe6db34f7d17b4c77fff4835fe4678f
  3. Adapt tests to new multidimensionality

    vmx committed Jun 10, 2016
    The multidimensional version of GeoCouch doesn't the plane_bounds parameter
    anymore.
    
    Change-Id: I98f815cba3a94fda90b2bdcf7df378ecb1d86316
  4. Adapt tests to new multidimensionality

    vmx committed Jun 10, 2016
    The multidimensional version of GeoCouch doesn't have a `bbox` property
    in the response anymore. It now returns only the key.
    
    Change-Id: I82f166afe2a07e8108b5fea2a029ea74eff969e1
  5. Use tuples instead of list for ranges

    vmx committed Jun 10, 2016
    Change-Id: I65c793e1a0e13ad4db4461a3595a98a48a280d1a
  6. MB-12251: Improve query parsing errors

    vmx committed Jun 10, 2016
    Add more end-user friendly error messages when the query parameter
    are invalid. This commit also adds tests.
    
    This is a port of f4753a3 to the
    Apache CouchDB compatible version for GeoCouch (without tests).
    
    Change-Id: I88b829eca0211007f536d89aeb84f06b97c8aa28
  7. CBIDXT-253: Encode geometries as WKB (Well-Known Binary)

    vmx committed Jun 10, 2016
    The geometries were stored as Erlang terms on disk. This is bad for
    interoperability. The geometries are now stored as WKB (Well-Known Binary).
    
    This is a port of 59fa359 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: I76b834461bd14b5ac684b6b4f52d3da8db8b8f95
  8. MB-12251: Throw error when only `start_range` or `end_range` is given

    vmx committed Jun 10, 2016
    You need to supply both, `start_range` and `end_range` if you supply it
    at all.
    
    This is a port of 37a81c7 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: Id6406a72f1b40e9c04d21203d61da91dad5c13ed
  9. MB-12251: Use original MBB for dimensionality comparison

    vmx committed Jun 10, 2016
    The key of the root node can be be unset. Hence use the original MBB
    for the comparison between the query and the index dimensionality.
    The original MBB is always set and has the same dimensionality the
    index has.
    
    This is a port of 0736029 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: Idf8043eba608e895d72bf7e541d8892582bb313a
  10. MB-12251: Better error messages during emit

    vmx committed Jun 10, 2016
    The errors on emit now are more specific. Their error atom is `key_emit`
    instead of just `error`.
    
    This is a port of 16cdbf7 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: I29955af94249df37a2bd553ccb28ad354eb08fc2
  11. MB-12251: Throw error when range has wrong dimensionality

    vmx committed Jun 10, 2016
    In case you query with a range that doesn't have the same dimensionality
    as the index it throws a proper error now:
    
        The query range must have the same dimensionality as the index.
    
    This is a port of 82a4ba0 to the
    Apache CouchDB compatible version for GeoCouch (without the tests).
    
    Change-Id: Ic68eb903cbafcae226720a8658b9686e6c183347
  12. MB-12251: Better error messages for emits

    vmx committed Jun 10, 2016
    When there were non-valid emits the error messages weren't meaningful.
    This commits adds nicer error messages and tests accordingly.
    
    This is a port of 57d20b4 to the
    Apache CouchDB compatible version for GeoCouch (without the tests).
    
    Change-Id: I2e78cc4834ccf9999d3100a5425546b9d2873807
  13. Always use lists for query key calculations

    vmx committed Jun 10, 2016
    Change-Id: I3ea7cd8b15b45eb4d3aec16ea9c3d18d07642075
  14. String instead of binary was returned

    vmx committed Jun 10, 2016
    GeometryCollection returned the property `geometries` as a string
    and not as a binary.
    
    This is a port of 9b267f1 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: I916a366219363ce2692189093d49530350d3a877
  15. Compile WKB module

    vmx committed Jun 10, 2016
    Change-Id: Ifa3550150e965aa611d569e4ba269683effed031
  16. Fix bounding box calculation

    vmx committed Jun 10, 2016
    The bounding box calculation expected tuples instead of lists. This
    broke the boudning box calculation of linestrings and polygons.
    
    This is a port of e9025d5 to the
    Apache CouchDB compatible version for GeoCouch.
    
    Change-Id: I857d8493344f3aa7c2d00b1482cebbcec96474b9
  17. Make it compile properly

    vmx committed with vmx Jan 6, 2016
    The include path to Apache CouchDB wasn't set correctly.
    
    Change-Id: I5cb55a4c25e1e8ee8366a38e24e6f8ef2e2d637b
  18. Fix syntax error in WKB app.src file

    vmx committed with vmx Jun 10, 2016
    Change-Id: I97a37cb9c4142d51592e9b42436b2ffcd74628ad
    Reviewed-on: http://review.couchbase.org/64877
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
Commits on Apr 7, 2016
  1. Remove unwanted start/end reduce context

    hsharsha committed with hsharsha Apr 1, 2016
    Change-Id: I939e75c9689d41c806a34d77f93f69a3ab7a5ff5
    Reviewed-on: http://review.couchbase.org/62451
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
Commits on Mar 14, 2016
  1. CBD-1453: Adapt to CMake macro changes

    vmx committed with vmx Mar 9, 2016
    The ERL_BUILD CMake macro was changed to make incremental builds possible.
    Adapt to those changes.
    
    Change-Id: Iae6d0a9043ed1b74f2c104d9b251f45715ac04fd
    Reviewed-on: http://review.couchbase.org/61151
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
Commits on Feb 15, 2016
  1. MB-7013: Fix Markdown syntax of the README.

    vmx committed with vmx Feb 15, 2016
    There was a code block that wasn't properly idented.
    
    Change-Id: Ibfd600d95b6b4ff48bc64e90393bd1ec360ff5e9
    Reviewed-on: http://review.couchbase.org/59947
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
Commits on Jan 22, 2016
  1. MB-17460: Fix compaction for empty spatial views

    vmx committed with vmx Jan 18, 2016
    When you tried to compact a spatial view that didn't contain any data
    after rebalance, it failed. The problem was a wrongly encoded root
    node in case of an empty tree.
    
    Change-Id: Icafe750e043e99f6d981b3afb34b6be577b7a561
    Reviewed-on: http://review.couchbase.org/58741
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Commits on Jan 18, 2016
  1. Fix typespec

    vmx committed with vmx Jan 15, 2016
    Dialyzer complains about a case that can't happen, that's due to a
    missing value in a typespec. The warning was:
    
        spatial_view.erl:117: The pattern <'nil', MbbB> can never match the type <[[number()]],_>
    
    Change-Id: I3178369d741e5a900375f914ba2efad5b094049b
    Reviewed-on: http://review.couchbase.org/58693
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
Commits on Jan 15, 2016
  1. MB-17382: Expand bounding box on subsequent calls

    vmx committed with vmx Jan 15, 2016
    There can be several flushes of the KVs during the initial indexing.
    Make sure the bounding box is calculated for the whole data set and
    not just the current call.
    
    Change-Id: I1d4e7f544a981a047d26cb2fe7e70116b57c86ac
    Reviewed-on: http://review.couchbase.org/58692
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
Commits on Jan 7, 2016
  1. MB-7013: Update Apache CouchDB section in the README

    vmx committed Jan 7, 2016
    Change-Id: If371b5317a3bd36e8c3012e162a0b024d154e721
    Reviewed-on: http://review.couchbase.org/58339
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
Commits on Aug 10, 2015
  1. MB-15975: Always find a split candidate

    vmx committed with vmx Aug 7, 2015
    There was a case where no split candidate was found. It happens when
    there are large nodes (e.g. due to large geometries) where the splitting
    rules need to be relaxed.
    
    In this particular case it happens when there are two nodes where the
    minimum fill rule can't be achieved for both nodes. It is then ignored.
    Instead the first partition of the split candidate is filled up to the
    maximum fill rate.
    
    If the last node in a list of nodes leads to this overflow, it will still
    be part of the first partition. This would lead to an empty second partition.
    
    The fix is to always make sure the second partition has at least one node.
    
    Change-Id: I1971306f20fbc0afe917b8754bd8e430f43a58c1
    Reviewed-on: http://review.couchbase.org/54222
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
Commits on Jun 22, 2015
  1. MB-15256: Don't allow mixed views in design documents

    vmx committed with vmx Jun 15, 2015
    A design document may only contain mapreduce *or* spatial views. If
    you try to add a design document with mixed views an error is thrown:
    
        $ curl -X PUT 'http://localhost:8092/default/_design/mapreduce' -d '{"views":{"mr":{"map":"function (doc, meta) {\n  emit(meta.id, null);\n}"}}}' -H 'Content-Type: application/json'
        {"ok":true,"id":"_design/mapreduce"}
    
        $ curl -X PUT 'http://localhost:9500/default/_design/spatial' -d '{"spatial":{"sp":"function (doc) {\n  if (doc.geometry) {\n    emit([doc.geometry], null);\n  }\n}"}}' -H 'Content-Type: application/json'
        {"ok":true,"id":"_design/spatial"}
    
        $ curl -X PUT 'http://localhost:9500/default/_design/mixed' -d '{"views":{"mr":{"map":"function (doc, meta) {\n  emit(meta.id, null);\n}"}}, "spatial":{"sp":"function (doc) {\n  if (doc.geometry) {\n    emit([doc.geometry], null);\n  }\n}"}}' -H 'Content-Type: application/json'
        {"error":"invalid_design_document","reason":"A design document may only contain mapreduce *or* spatial views"}
    
    Change-Id: I03a91ef02a8f4cbc30e0396022264acb8d23591b
    Reviewed-on: http://review.couchbase.org/52068
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
Commits on Jun 18, 2015
  1. MB-15315: Re-introducing validation for spatial views

    vmx committed with vmx Jun 15, 2015
    During the rewrite of the spatial views for Couchbase 3.x the validation
    of the spatial views [1] got lost. This commits adds it back.
    
    [1]: f89b626
    
    Change-Id: Id8e397f01c3abcefba02d6d7f50a53c8d111986b
    Reviewed-on: http://review.couchbase.org/52065
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Commits on May 6, 2015
  1. MB-14779: Throw error when key is not an array or GeoJSON geometry

    vmx committed with vmx May 4, 2015
    In spatial views the key need to follow certain rules. It must be either
    an array of numbers, an array with a leading GeoJSON geometry or (for
    legacy support) a single GeoJSON geometry. If something else is emitted,
    like a boolean a string or `null`, throw an error:
    
        The key must be an array of numbers which might
        have a GeoJSON geometry as first element.
    
    Change-Id: I23211c916a3145f58150e25b50f887128f555e13
    Reviewed-on: http://review.couchbase.org/50564
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>
Commits on Apr 20, 2015
  1. MB-14470: Make spatial views work with active replica partitions

    vmx committed with vmx Apr 15, 2015
    If some replica partitions are active, the spatial view merger failed.
    
    Change-Id: I3adaa16d6b4c53f189fd582fe43dd682a5dd0082
    Reviewed-on: http://review.couchbase.org/49741
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
Commits on Apr 15, 2015
  1. MB-14401: Unit test for emitting a large geometry as key

    vmx committed with vmx Apr 13, 2015
    Change-Id: I2bc309cb8fe55ab074919c1ea63ba9826e4943b8
    Reviewed-on: http://review.couchbase.org/49617
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Nimish Gupta <nimish@couchbase.com>