<commit_before>/**********************************************************************
 *
 * GEOS - Geometry Engine Open Source
 * http://geos.osgeo.org
 *
 * Copyright (C) 2006 Refractions Research Inc.
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
 *
 * This is free software; you can redistribute and/or modify it under
 * the terms of the GNU Lesser General Public Licence as published
 * by the Free Software Foundation.
 * See the COPYING file for more information.
 *
 **********************************************************************
 *
 * Last port: operation/distance/GeometryLocation.java rev. 1.7 (JTS-1.10)
 *
 **********************************************************************/

#include <geos/io/WKTWriter.h>
#include <geos/geom/Geometry.h>
#include <geos/operation/distance/GeometryLocation.h>

using namespace geos::geom;

namespace geos {
namespace operation { // geos.operation
namespace distance { // geos.operation.distance

/**
* Constructs a GeometryLocation specifying a point on a geometry, as well as the
* segment that the point is on (or INSIDE_AREA if the point is not on a segment).
*/
GeometryLocation::GeometryLocation(const Geometry* newComponent, size_t newSegIndex, const Coordinate& newPt)
{
    component = newComponent;
    segIndex = newSegIndex;
    inside_area = false;
    pt = newPt;
}

/**
* Constructs a GeometryLocation specifying a point inside an area geometry.
*/
GeometryLocation::GeometryLocation(const Geometry* newComponent, const Coordinate& newPt)
{
    component = newComponent;
    inside_area = true;
    segIndex = INSIDE_AREA;
    pt = newPt;
}

/**
* Returns the geometry associated with this location.
*/<commit_msg>cast type of INSIDE_AREA to match segIndex<commit_after>/**********************************************************************
 *
 * GEOS - Geometry Engine Open Source
 * http://geos.osgeo.org
 *
 * Copyright (C) 2006 Refractions Research Inc.
 * Copyright (C) 2001-2002 Vivid Solutions Inc.
 *
 * This is free software; you can redistribute and/or modify it under
 * the terms of the GNU Lesser General Public Licence as published
 * by the Free Software Foundation.
 * See the COPYING file for more information.
 *
 **********************************************************************
 *
 * Last port: operation/distance/GeometryLocation.java rev. 1.7 (JTS-1.10)
 *
 **********************************************************************/

#include <geos/io/WKTWriter.h>
#include <geos/geom/Geometry.h>
#include <geos/operation/distance/GeometryLocation.h>

using namespace geos::geom;

namespace geos {
namespace operation { // geos.operation
namespace distance { // geos.operation.distance

/**
* Constructs a GeometryLocation specifying a point on a geometry, as well as the
* segment that the point is on (or INSIDE_AREA if the point is not on a segment).
*/
GeometryLocation::GeometryLocation(const Geometry* newComponent, size_t newSegIndex, const Coordinate& newPt)
{
    component = newComponent;
    segIndex = newSegIndex;
    inside_area = false;
    pt = newPt;
}

/**
* Constructs a GeometryLocation specifying a point inside an area geometry.
*/
GeometryLocation::GeometryLocation(const Geometry* newComponent, const Coordinate& newPt)
{
    component = newComponent;
    inside_area = true;
    segIndex = (size_t) INSIDE_AREA;
    pt = newPt;
}

/**
* Returns the geometry associated with this location.
*/
{'fraction_non_alphanumeric': 0.20491803278688525, 'fraction_numerical': 0.009953161592505855, 'mean_word_length': 4.676079734219269, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2356745', 'n_tokens_mistral': 954, 'n_tokens_neox': 886, 'n_words': 311}