mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
fix typos and grammar issues
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
When using Nominatim through the library, it can be configured in exactly
|
||||
the same way as when running as a service. This means that you should have
|
||||
created a [project directory](../admin/Import.md#creating-the-project-directory)
|
||||
which contains all files belonging to the Noinatim instance. It can also contain
|
||||
an `.env` file with configuration options. Setting configuration paramters
|
||||
which contains all files belonging to the Nominatim instance. It can also contain
|
||||
an `.env` file with configuration options. Setting configuration parameters
|
||||
via environment variables works as well.
|
||||
|
||||
Configuration options are resolved in the following order:
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
The Nominatim search frontend can directly be used as a Python library in
|
||||
scripts and applications. When you have imported your own Nominatim database,
|
||||
then it is no longer necessary to run a full web service for it and access
|
||||
the database through http requests. With the Nominatim library it is possible
|
||||
to access all search functionality directly from your Python code. There are
|
||||
the database through http requests. There are
|
||||
also less constraints on the kinds of data that can be accessed. The library
|
||||
allows to get access to more detailed information about the objects saved
|
||||
in the database.
|
||||
@@ -14,8 +13,8 @@ in the database.
|
||||
be some smaller adjustments to the public interface until the next version.
|
||||
|
||||
The library also misses a proper installation routine, so some manipulation
|
||||
of the PYTHONPATH is required. Use is only recommended for advanced Python
|
||||
programmers at the moment.
|
||||
of the PYTHONPATH is required. At the moment, use is only recommended for
|
||||
developers wit some experience in Python.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -55,7 +54,7 @@ This code snippet implements a simple search for the town if 'Brugge':
|
||||
if not results:
|
||||
print('Cannot find Brugge')
|
||||
else:
|
||||
print(f'Found a place at {results[0].centroid.x},{results[1].centroid.y}')
|
||||
print(f'Found a place at {results[0].centroid.x},{results[0].centroid.y}')
|
||||
```
|
||||
|
||||
=== "NominatimAPI"
|
||||
@@ -71,7 +70,7 @@ This code snippet implements a simple search for the town if 'Brugge':
|
||||
if not results:
|
||||
print('Cannot find Brugge')
|
||||
else:
|
||||
print(f'Found a place at {results[0].centroid.x},{results[1].centroid.y}')
|
||||
print(f'Found a place at {results[0].centroid.x},{results[0].centroid.y}')
|
||||
```
|
||||
|
||||
The Nominatim library is designed around
|
||||
@@ -83,8 +82,8 @@ significantly.
|
||||
For smaller scripts there is also a synchronous wrapper around the API. By
|
||||
using `NominatimAPI`, you get exactly the same interface using classic functions.
|
||||
|
||||
The examples in this chapter will always show how work with both of the
|
||||
implementations. The documentation itself will refer usually only to
|
||||
The examples in this chapter will always show-case both
|
||||
implementations. The documentation itself will usually refer only to
|
||||
'Nominatim API class' when both flavours are meant. If a functionality is
|
||||
available only for the synchronous or asynchronous version, this will be
|
||||
explicitly mentioned.
|
||||
@@ -104,7 +103,7 @@ You should have set up this directory as part of the Nominatim import.
|
||||
Any configuration found in the `.env` file in this directory will automatically
|
||||
used.
|
||||
|
||||
The second way to configure your Nominatim setup is through environment variables.
|
||||
Yo may also configure Nominatim be setting environment variables.
|
||||
Normally, Nominatim will check the operating system environment. This can be
|
||||
overwritten by giving the constructor a dictionary of configuration parameters.
|
||||
|
||||
@@ -209,8 +208,8 @@ results should be presented. As with the names in the result itself, the
|
||||
places in `address_rows` contain all possible name translation for each row.
|
||||
|
||||
The library has a helper class `Locale` which helps extracting a name of a
|
||||
place in the preferred language. It gets a list of language code in the
|
||||
order of preference. So
|
||||
place in the preferred language. It takes a single parameter with a list
|
||||
of language codes in the order of preference. So
|
||||
|
||||
``` python
|
||||
locale = napi.Locale(['fr', 'en'])
|
||||
|
||||
@@ -7,8 +7,8 @@ in the query functions of the API object.
|
||||
|
||||
The [details](NominatimAPI.md#nominatim.api.core.NominatimAPI.details) and
|
||||
[lookup](NominatimAPI.md#nominatim.api.core.NominatimAPI.lookup) functions
|
||||
require references to places in the database. Below are listed the possible
|
||||
types for place identification. All types are dataclasses.
|
||||
require references to places in the database. Below the possible
|
||||
types for place identification are listed. All types are dataclasses.
|
||||
|
||||
### PlaceID
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Low-level connections
|
||||
|
||||
The `NominatimAPIAsync` class allows to directly access the underlying
|
||||
database connection to explore the data more directly. Nominatim uses
|
||||
database connection to explore the raw data. Nominatim uses
|
||||
[SQLAlchemy](https://docs.sqlalchemy.org/) for building queries. Please
|
||||
refer to the documentation of the library to understand how to write SQL.
|
||||
|
||||
To get access to a search connection, use the `begin()` function of your
|
||||
API object. The function returns a context manager. Use with a `with`
|
||||
statement. This returns a `SearchConnection` object described below. Its
|
||||
API object. This returns a `SearchConnection` object described below
|
||||
wrapped in a context manager. Its
|
||||
`t` property has definitions for all Nominatim search tables. For an
|
||||
overview of available tables, refer to the
|
||||
[Development Layout](../develop/Database-Layout.md) in in the development
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Result handling
|
||||
|
||||
The search functions of the Nominatim API always return a result object that
|
||||
contains the full raw information about the place that is available in the
|
||||
The search functions of the Nominatim API always return a result object
|
||||
with the raw information about the place that is available in the
|
||||
database. This section discusses data types used in the results and utility
|
||||
functions that allow further processing of the results.
|
||||
|
||||
@@ -9,8 +9,8 @@ functions that allow further processing of the results.
|
||||
|
||||
### Sources
|
||||
|
||||
Nominatim takes the result data from multiple souces. The `source_table` field
|
||||
in the result describes, from which source the result was retrived.
|
||||
Nominatim takes the result data from multiple sources. The `source_table` field
|
||||
in the result describes, from which source the result was retrieved.
|
||||
|
||||
::: nominatim.api.SourceTable
|
||||
options:
|
||||
@@ -21,15 +21,15 @@ in the result describes, from which source the result was retrived.
|
||||
|
||||
When the `address_details` parameter is set, then functions return not
|
||||
only information about the result place but also about the place that
|
||||
make up the address. This information is almost always required, when you
|
||||
make up the address. This information is almost always required when you
|
||||
want to present the user with a human-readable description of the result.
|
||||
See also [Localization](#localization) below.
|
||||
|
||||
The address details are available in the `address_rows` field as a ordered
|
||||
list of `AddressLine` objects with the country information last. The list also
|
||||
contains the result place itself and some artificial entries, for example,
|
||||
for the housenumber or the country code. This makes processing and creating
|
||||
a full address easiert.
|
||||
for the house number or the country code. This makes processing and creating
|
||||
a full address easier.
|
||||
|
||||
::: nominatim.api.AddressLine
|
||||
options:
|
||||
|
||||
Reference in New Issue
Block a user